nullptr: A Type-safe and Clear-Cut Null Pointer

Whether you're using NULL or 0, your C++ apps are subjected to bugs and maintenance problems that are caused by the ambiguity of 0. Find out how to use the nullptr keyword instead of 0 to indicate a null pointer value.

WEBINAR:

On-Demand

he new C++09 nullptr keyword designates an rvalue constant that serves as a universal null pointer literal, replacing the buggy and weakly-typed literal 0 and the infamous NULL macro. nullptr thus puts an end to more than 30 years of embarrassment, ambiguity, and bugs. The following sections present the nullptr facility and show how it can remedy the ailments of NULL and 0.

The literal 0 (which is essentially of type int) also serves as a null pointer literal in C++. This kludge results in ambiguity and bugs.

Use the nullptr keyword instead of 0 to indicate a null pointer value.

Advertiser Disclosure:
Some of the products that appear on this site are from companies from which QuinStreet receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. QuinStreet does not include all companies or all types of products available in the marketplace.

Thanks for your registration, follow us on our social networks to keep up-to-date