R
Rolf Magnus
Chris said:printf("%p\n", NULL);
will not have the expected effect on systems where pointers are not
identical in representation to ints. Whereas if NULL is not used,
printf("%p\n", 0);
is obviously wrong. (In real code it's unlikely to be printf(), no one
is likely to want to print the value of an explicitly null pointer, but
there are other functions where the same effect occurs.)
Yes, and there is also the argument about overloaded functions (see my other
posting), where one function takes an int and the other a pointer. If you
call it with NULL as argument, it's the int version that is called, not (as
one might be fooled into expecting) the pointer version. And this problem
exists on every implementation, not just some, like the varargs problem.
I usually use 0 rather than NULL in C++ code when assigning a null
pointer, but I don't onject strongly to NULL either. It's one of those
style issues...
Yes. That's why the thread is growing so rapidly ;-)