p1
and p2
are null pointers; p3
is implementation defined,
and may be something else. (A comma operator cannot be part of
a constant expression. And the mapping of a non-constant
integral value 0 to a pointer is implementation defined.) C is
identical to C++ here.
p8
and p9
are both null pointers in C++, but not in C.
With regards to your comment on static_zero_2
, there is no
requirement in either language that a literal zero be present,
anywhere. g++ defines NULL
as the compiler built-in __null
,
for example, and you can use (1 - 1)
, or '\0'
, or any other
constant expression evaluating to 0.