Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!uflorida!mephisto!mcnc!rti!dg-rtp!dg-rtp.dg.com!goudreau From: goudreau@dg-rtp.dg.com (Bob Goudreau) Newsgroups: comp.lang.c Subject: Re: Seven Original Sins of K&R (Long) Message-ID: <1990Sep28.214000.14582@dg-rtp.dg.com> Date: 28 Sep 90 21:40:00 GMT References: <12780@sdcc6.ucsd.edu> <1990Sep26.163927.26084@dg-rtp.dg.com> <1990Sep28.112637.10446@zeus.usq.edu.au> Sender: usenet@dg-rtp.dg.com (Usenet Administration) Reply-To: goudreau@dg-rtp.dg.com (Bob Goudreau) Organization: Data General Corporation, Research Triangle Park, NC Lines: 29 In article <1990Sep28.112637.10446@zeus.usq.edu.au>, s64421@zeus.usq.edu.au (house ron) writes: > goudreau@dg-rtp.dg.com (Bob Goudreau) writes: > > >In article <1990Sep26.193626.721@phri.nyu.edu>, roy@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@dg-rtp.dg.com Research Triangle Park, NC 27709 ...!mcnc!rti!xyzzy!goudreau USA