Seven Original Sins of K&R (Long)
The Teenage Student WINJA Turbot
maunz at warwick.ac.uk
Thu Sep 27 17:37:30 AEST 1990
In article <1990Sep26.193626.721 at phri.nyu.edu> roy at phri.nyu.edu (Roy Smith) writes:
>
>What about this for a portable way to define NULL:
>
>#define NULL (""[1])
>
>would that work?
B L E U G H ! !
This is a joke, right?
("") is a null-terminated empty string, no?
Functionally equivalent to a char pointer which refers to an ASCII NUL or
char (0), no?
(""[1]) is probably a char pointer to garbage, no?
Either this is a joke, or I have missed the point.
Either way I'm stupid.
I must agree with the poster/author of the 'original sins' about NULL though.
It would be nice if NULL had been made unnecessary by a standardised keyword
such as 'nullpointer' or something. But nobody could have expected K & R to
have crystal balls.
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\ \/ /. \ JANET maunz at uk.ac.warwick.cu / "As the people here grow
\/\/ I N J A \ (K R Turner) / colder..." -- Kate Bush
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
More information about the Comp.lang.c
mailing list