nullptr
nullptr is the null pointer literal in C++11 and later. It is a keyword that denotes a null pointer value and is the preferred way to represent “no object” for pointer types. The type of the nullptr literal is std::nullptr_t, a distinct type defined by the language, and the value is the sole instance of that type.
Semantics and usage: nullptr is implicitly convertible to any pointer type and to any pointer-to-member type,
Differences from older null representations: Prior to C++11, programmers commonly used 0 or the NULL macro to
Standard definitions and availability: nullptr is a core language feature and is available in the C++ standard
if (p == nullptr) { /* ... */ }
f(nullptr); // selects f(int*) over f(int)
Overall, nullptr improves safety and clarity in pointer-related code, and is now widely adopted as the