first of all, if(!(blah)) and if(!blah) should be exactly the same, unless you have relatively rare case that blah has been #defined for the preprocessor, in which case the substitution might confuse you:
example:
bool foo; extern bool myfunc(int n);
#define blah foo && myfunc(4)
now, "if(!blah)" expands to "if(!foo && myfunc(4))", but "if(!(blah))" expands to "if(!(foo && myfunc(4)))"
now, the other situation, testing whether blah is defined... if you are using javascript, then I think that is what this does, but otherwise, there are two slightly different cases:
in C, if(blah) "converts" blah to a number, and evaluates the guarded code if the number is nonzero (if the number is 0 then it evaluates the "else" clause)... so, if blah is a number type, then the normal test case happens, if blah is a pointer type, the same thing, the pointer is treated as a number (so the guarded code is executed if the pointer is not NULL))
in C++, the semantics fall back to C, to maintain backwards compatibility, but if blah is a variable of type "bool", or another type which has defined an implicit conversion to bool, then it uses this bool value
would resolve to "if foo is not true, and myfunc(4) is true"
"if(!(blah))" expands to "if(!(foo && myfunc(4)))"
would resolve to "the opposite of the result of checking if foo and myfunc(4) are both true".
-fel
~ The opinions stated by this individual are the opinions of this individual and not the opinions of her company, any organization she might be part of, her parrot, or anyone else. ~