Zero/nil/NULL/NUL/0/...

John Stanley stanley at phoenix.com
Sun Apr 21 04:39:21 AEST 1991


gnat at kauri.vuw.ac.nz (Nathan Torkington) writes:

> I have read the FAQ and this doesn't seem to be what I'm after.  What I
> am looking for is an explicit list of things which 0 (zero decimal, zero
> octal, zero hexadecimal, etc) stand for.  So far I have :
>   -> The number zero (in any base)

   Yes, zero is zero.

>   -> The unused pointer (in some machines)

   Do you mean "the null pointer"? It is possible to have used a pointer
and for it to be null. For example, you may use it to indicate to a
function that it should ignore a pointer parameter. Or, fopen returns
a NULL pointer on failure. In either case, the pointer has been used.

   In any case, the null pointer is NULL, which may or may not be hex
0.

>   -> End of file (EOF)

   EOF is not 0, since there would be no way to differentiate it from
the NUL character.



More information about the Comp.lang.c mailing list