S
Stefan Ram
Wojtek said:I said context.
int a = 0;
0 in this context is not a null pointer constant.
It is. The specification does not require a special context.
So you make up rules about the context that are not written in
the specification anywhere.
For the readers convenience, I will give a more complete
quotation:
»An integer constant expression with the value 0, or such
an expression cast to type void *, is called a null
pointer constant. If a null pointer constant is converted
to a pointer type, the resulting pointer, called a null
pointer, is guaranteed to compare unequal to a pointer to
any object or function.«
ISO/IEC 9899:1999 (E), 6.3.2.3, #3
So, you can rightfully say, that in the above context »0« is
not a »null pointer« (see the second sentence of the
quotation). But it is a /null pointer constant/, even in
»int a = 0;«.
Yes, a /null pointer constant/ is not a /null pointer/ and
vice versa.
I was speaking of »null pointer constant«. You seem to
have been speaking of »null pointer«.