Dereferencing a null pointer
suggest changeThis is an example of dereferencing a NULL pointer, causing undefined behavior.
int * pointer = NULL;
int value = *pointer; /* Dereferencing happens here */
A NULL
pointer is guaranteed by the C standard to compare unequal to any pointer to a valid object, and dereferencing it invokes undefined behavior.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents