Abstract
When a C++ pointer is NULL, it does not point to any location in the memory. Similarly, when an object reference does not point to any object, its value is nullptr. The nullptr is a keyword in C++\CLI. However, unlike NULL, nullptr is safer and is not a type. A NULL at the end of the day is an integer constant. Because nullptr is not a type, no type operations can be done on nullptr—sizeof(nullptr), throw nullptr, and so forth will all result in compiler errors.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2016 Vivek Ragunathan
About this chapter
Cite this chapter
Ragunathan, V. (2016). Nullptr. In: C++/CLI Primer. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-2367-3_18
Download citation
DOI: https://doi.org/10.1007/978-1-4842-2367-3_18
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-2366-6
Online ISBN: 978-1-4842-2367-3
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books