how can i tell if a class is instantiated.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am new to C# (from C++). I do:
foo = new Client(this);

later on I want to check if I actually have done this "new". I use to
do:

if (foo == NULL) //not instantiated so new it...

what do i do in C#?
thanks
 
Debug.Assert(objectName != null, "Class is NOT instantiated");
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top