How to test if an enum variable was not assigned
If I have a NSString variable I can test if the variable was not assigned
yet by doing
if (!variable) {
[self doSomething];
}
but what about this?
typedef enum {
car = 100,
home,
flower,
} object;
object myVar;
if (!myVar) // ??? is this correct?
is this really testing if the variable has been already assigned or
contains a value?
thanks
No comments:
Post a Comment