Google News
logo
Embedded C - Interview Questions
What do you understand by a null pointer in Embedded C?
A null pointer is a pointer that does not point to any valid memory location. It is defined to ensure that the pointer should not be used to modify anything as it is invalid. If no address is assigned to the pointer, it is set to NULL.
 
Syntax : 
data_type *pointer_name = NULL;
One of the uses of the null pointer is that once the memory allocated to a pointer is freed up, we will be using NULL to assign to the pointer so that it does not point to any garbage locations.
Advertisement