Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


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.




Building the Right Environment to Support AI, Machine Learning and Deep Learning

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.

Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



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