-
Static class == NULL
Hello!
I have serveral classes with static variables/methods. I want to check objects from these classes whether they are NULL or not this way:
Code:
MyClassWithStaticFunctions *x;
if (!x) printf("x is null");
"x" never seems to be NULL. How can this be?
Greetings,
-
already got it working...
-
I'm guessing you figured out the fact that variables aren't initiallized to a default value in the language spec, and that only some compilers might set a pointer to null at creation, others will use something else, or possibly just leave it with the garbage already in memory.