Does NULL pointer take any memory?
If it takes memory,then how much memory is consumed by it and what is the significant use of NULL pointer if it takes memory?
A pointer value (
NULL or not) requires some amount of space to store and represent (4 to 8 bytes on most modern desktop systems, but could be some oddball size depending on the architecture).
The pointer value
NULL represents a well-defined "nowhere"; it's an invalid pointer value guaranteed to compare unequal to the address of any object or function in memory. The macro
NULL is set to the null pointer constant, which is a zero-valued integer expression (either a naked
(void *) 0, or some other expression that evaluates to
After the code has been compiled, the null pointer constant will be replaced with the appropriate null pointer value for that particular platform (which may be
0xDEADBEEF, or some other value).