Pointer declaration

Declares a variable of a pointer or pointer-to-member type.

# Defect reports

DRApplied toBehavior as publishedCorrect behavior
CWG 73C++98a pointer to an object never compares equalto a pointer to one past the end of an arrayfor non-null and non-function pointers,compare the addresses they represent
CWG 903C++98any integral constant expression thatevaluates to 0 was a null pointer constantlimited to integerliterals with value 0
CWG 1438C++98the behavior of using an invalid pointervalue in any way was undefinedbehaviors other than indirection andpassing to deallocation functionsare implementation-defined
CWG 1512(N3624)C++98the rule of composite pointer type was incomplete, and thusdid not allow comparison between int** and const int**made complete
CWG 2206C++98a pointer to void and a pointer tofunction had a composite pointer typethey do not have such a type
CWG 2381C++17function pointer conversions were not allowedwhen determining the composite pointer typeallowed
CWG 2822C++98reaching the end of the duration of a regionof storage could invalidate pointer valuespointer validity is basedon the evaluation context
CWG 2933C++98pointers to functions were always invalidthey are always valid

# See also