NULL Pointers in C Programming
A pointer that is assigned NULL is called a null pointer. We must initialize NULL pointer during variable declaration. A null pointer refers to pointer variable that does not point to a valid address. Generally NULL pointer is used when you do not have an exact address to be assigned.
1 2 3 4 5 6 7 8 9 10 | #include <stdio.h> int main () { int *ptr = NULL; printf("The value of ptr is : %d", ptr ); return 0; } |
OUTPUT
1 | The value of ptr is : 0 |