12-09-2013, 09:22 AM
The standard (ISO 9899:1999 6.3.2.3) defines a null pointer constant:
The semantics are subtly different in C++
Quote:An integral constant expression with the value 0 , or such an expression cast to type void *, is called a null pointer constant.This means, for example that it is legitimate in the C language to compare a pointer expression with any form of integer constant expression including for example '\0' or any enum constant of value 0. For this reason it is advisable to use NULL wherever a null pointer constant is intended.
The semantics are subtly different in C++
Posted by and on behalf of the MISRA C Working Group