Seven Original Sins of K&R (Long)

Bob Goudreau goudreau at dg-rtp.dg.com
Sat Sep 29 07:40:00 AEST 1990


In article <1990Sep28.112637.10446 at zeus.usq.edu.au>,
s64421 at zeus.usq.edu.au (house ron) writes:
> goudreau at dg-rtp.dg.com (Bob Goudreau) writes:
> 
> >In article <1990Sep26.193626.721 at phri.nyu.edu>, roy at phri.nyu.edu
(Roy
> >Smith) writes:
> >> 
> >> #define NULL (""[1])
> >> 
> >> would that work?
> 
> >Nope; it's not even *defined* behavior to access beyond the end of
> >an array, which is what you've done.
> 
> I think he means 
> 
>    #define NULL (""[0])

... which is still wrong, though at least it's a legal array access.
The NUL character ('\0') is *not* the same as the null pointer.  See
the FAQ posting for details.
 
----------------------------------------------------------------------
Bob Goudreau				+1 919 248 6231
Data General Corporation
62 Alexander Drive			goudreau at dg-rtp.dg.com
Research Triangle Park, NC  27709	...!mcnc!rti!xyzzy!goudreau
USA



More information about the Comp.lang.c mailing list