There are times when it?s necessary to have a pointer that doesn?t point to anything. The macro NULL, defined in <stddef.h>, 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 NULL.
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
Null pointer assignment really means that you are using an pointer that points to address location zero.Usually,This address location contains some information about compiler and if it is accessed and modified the original information is modified and when programmed is terminated the information block is checked and if the original information is changed then it is confirmed that a null pointer assignment has been taken place and that warns for null pointer assignment.