nullptr Instead of 0 or NULL

In this lesson, we will learn how new null pointer nullptr cleans up in C++ with the ambiguity of the number 0 and the macro NULL.

The Number 0

The issue with the literal 0 is that it can be either the null pointer (void*)0 or the number 0 depending on the context of the problem in question.

Therefore, programs using the number 0 should be confusing.

Get hands-on with 1400+ tech skills courses.