There are times when itís necessary to have a
pointer that doesnít point to anything. The macro NULL, defined in ,
has a value thatís guaranteed to be different from any valid
pointer. NULL is a literal zero, possibly cast to void* or char*.
Some people, notably C++ programmers, prefer to use 0 rather than
The null pointer is used in three ways:
1) To stop indirection in a recursive data structure.
2) As an error value.
3) As a sentinel value.