Integral Constant Expressions

An integral constant expression that evaluates to zero is converted to a pointer called the "null pointer." This pointer is guaranteed to compare unequal to a pointer to any valid object or function (except for pointers to based objects, which can have the same offset and still point to different objects).

The following code illustrates the definition of a pointer to member i in class A. The pointer, pai, is initialized to 0, which is the null pointer.

// conve__pluslang_Integral_Constant_Expressions.cpp
class A
{
public:
 int i;
};

int A::*pai = 0;

int main()
{
}

See Also

Reference

Pointer-to-Member Conversions