NULL
NULL
is the pointer to nothing. It evaluates to 0, and is always
false in a boolean context.
You can never dereference NULL
. It is a run-time error at least,
and machine-crasher at worst.
Sometimes you see people use 0 as NULL
, but don't.
char *p = NULL; /* good */ char *p = 0; /* compiles the same, but less clear */TOC | Prev | Next