Interview Question

What is NULL?

NULL is a macro for a null pointer constant, not a dereferenceable address.

💡 Concept ✅ Quick Revision ⚙ C

Answer

NULL is a macro that expands to an implementation-defined null pointer constant. • A null pointer compares unequal to every pointer to an object or function. • NULL does not mean that address zero must be the machine representation. • A null pointer must not be dereferenced.

💡 C Example

int *pointer = NULL; if (pointer == NULL) { /* No object is designated. */ }

⚡ Quick Revision

NULL is a macro for a null pointer constant, not a dereferenceable address.