← BYTES
C++·Starter·Ref: 8.1.5

What does `nullptr` provide that the older `NULL` macro did not?

Have a question about this video? Mention reference 8.1.5 when you contact us.

a.Automatic memory deallocation
b.Faster runtime performance
c.A distinct pointer type that avoids ambiguity with integer 0 in overload resolution
d.Thread safety
nullptr has its own type (std::nullptr_t) that converts to any pointer type but not to int, resolving ambiguities where NULL (often just 0) could accidentally select an integer overload instead of a pointer one.

Find this on YouTube & Instagram

Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:

#BYTES#BYTES815#C