What is a Null Pointer and how it can be implemented?

Explain Null Pointer and its use.Where to use it? How it can be implemented in C++?

  • Shikha
  • 24 Jul 2018
  • 1004 Views
  • 3 Answers
Your Answer

Null Pointer is a pointer which doesn't pointing to any variable.It doesn't exists.It is always 0.
If you don’t have address to be assigned to pointer then you can  use NULL.
In C++:
float *ptr { 0 };
Here ptr is NULL pointer.
Similarly ,you can use int,double etc.

Object Oriented Programming

Didn't get the answer.
Contact people of Talent-Object Oriented Programming directly by clicking here