Null pointer is a pointer they point nothing in memory location and the null pointer is basically stored null value while void is the type of the pointer. It can be stores the base address of the segment.null means the pointer refer to the 0th memory location. We do not have address which is assigned to the pointer it is known as null pointer.
Following applications are null pointer:
It is used to perform error handling with pointer before de-referencing the pointers.
It is used to initalize 0 pointer variable when the pointer does not point to valid memory address.
Pass a null pointer to a function argument we do not want to pass the actual memory address.
Examples of the Null pointer.
Let’s see the example of malloc()function in null pointer
printf("Memory is not allocated");
printf("Memory is allocated");