NULL vs 0
rdsmith at exodus.UUCP
rdsmith at exodus.UUCP
Sat Jan 21 00:42:26 AEST 1984
Chris Torek says:
I have one little minor thing to say here. I don't know about those
68k systems that have sizeof (int) == 2, sizeof (char *) == 4, but all
the stdio.h files I've seen say
#define NULL 0
(NOT #define NULL ((char *) 0)), so it won't make a bit of difference
...
Chris is headed in the right direction with the stdio.h reference, but the
rest of the article really blows it. Of course all of the stdio.hs you've
seen have NULL defined that way; that is the way THOSE machines represent
NULL. The point is that << stdio.h IS THE PLACE WHERE SUCH A MACHINE
DEPENDENCY BELONGS >>, not scattered throughout user programs. Stick to
NULL, and expect each machine to properly define it in stdio.h.
Randy D. Smith CSO, Inc. HL 3L-528 (201) 564-3797
More information about the Comp.unix.wizards
mailing list