- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What should we assign to a C++ pointer: A Null or 0?
In C++, Null is defined as 0. Null or 0 is an integer.
In case of a pointer, we can assign a pointer p as −
Float* p = NULL; Float* p = 0; Float* p = nullptr;
3 of them will produce the same result. null ptr is a keyword introduced in C++11 as a replacement to NULL.
Advertisements