What is NULL pointer?

4 votes
71 views
Tarun Gautam asked 13-Nov-2017 in programming by Tarun Gautam

What is NULL pointer?

1 Answer

0 votes
Manish Kumar answered 13-Nov-2017 by Manish Kumar
In computing, a null pointer has a value reserved for indicating that the pointer does not refer to a valid object. Programs routinely use null pointers to represent conditions such as the end of a list of unknown length or the failure to perform some action; this use of null pointers can be compared to nullable types and to the Nothing value in an option type.
A null pointer should not be confused with an uninitialized pointer: A null pointer is guaranteed to compare unequal to any pointer that points to a valid object. However, depending on the language and implementation, an uninitialized pointer may not have any such guarantee. It might compare equal to other, valid pointers; or it might compare equal to null pointers. It might do both at different times.