Sunday, April 14, 2013

Difference between NUL and NULL in C

From "Expert C programming - Deep C secrets" book:

The one "l" NUL ends an ASCII string,
Two two "l" NULL points to no thing.

If you check your include files, you will see definition of null as

#define NULL ((void*)0)

while NUL is first symbol in ASCII table (with value of 0).

No comments:

Post a Comment