Code:
struct person *p = NULL;
printf("%d, %d\n", !p, !!p);
In above code, the !
operator works on pointer, I know !
works with int
, but what happens when it works with pointer
?
Is pointer treated as int
in nature, or the !
do a type convert?
I found the c99 reference mentioned in answer here: www.open-std.org/jtc1/sc22/WG14/www/docs/n1256.pdf