In C++11 and later versions, we can now use a proper null pointer value. It is named as
nullptr and is a C++ keyword. Unlike
NULL which were an integer and a pointer to
nullptr is cleaner and brings in stronger type checking.
nullptr can be assigned to any pointer variable.
I could not find the definition of
nullptr, I guess it is defined inside the compiler itself. The closest I could find is
nullptr_t, which is the type of
nullptr. For GCC 4.9, I found that this is defined in
typedef decltype(nullptr) nullptr_t;
Tried with: GCC 4.9.1 and Ubuntu 14.04