We now have C++11 with many new features. An interesting and confusing one (at least for me) is the new nullptr
.
Well, no need anymore for the nasty mac
nullptr
can't be assigned to an integral type such as an int
but only a pointer type; either a built-in pointer type such as int *ptr
or a smart pointer such as std::shared_ptr
I believe this is an important distinction because NULL
can still be assigned to both an integral type and a pointer as NULL
is a macro expanded to 0
which can serve as both an initial value for an int
as well as a pointer.