Generally in C++
you shouldn't use NULL
. In C
, NULL
is a macro for (void*)0
, whereas in C++
you should use 0
instead of NULL
. But you can't use false
instead of 0
for pointers! Apart from that, they are actually the same, sometimes causing confusion.
This is why in C++11
a nullptr
was defined as use for pointers.