
3 Jan
2008
3 Jan
'08
12:24 a.m.
On 02/01/2008, Robert Dailey
Where in the standard does it state that assigning an integral constant to a pointer type is legal? Perhaps there is some more generic rule in the standard to which this concept applies.
4.10 Pointer conversions [conv.ptr] 1) A null pointer constant is an integral constant expression (5.19) rvalue of integer type that evaluates to zero. A null pointer constant can be converted to a pointer type; the result is the null pointer value of that type and is distinguishable from every other value of pointer to object or pointer to function type. Two null pointer values of the same type shall compare equal.