Path: utzoo!attcan!uunet!van-bc!ubc-cs!alberta!mts.ucs.UAlberta.CA!Al_Dunbar From: userAKDU@mts.ucs.UAlberta.CA (Al Dunbar) Newsgroups: comp.lang.c Subject: Re: Seven Original Sins of K&R (Long) Message-ID: <1388@mts.ucs.UAlberta.CA> Date: 29 Sep 90 15:25:33 GMT References: <12780@sdcc6.ucsd.edu> <1990Sep26.163927.26084@dg-rtp.dg.com> <1990Sep28.112637.10446@zeus.usq.edu.au> Organization: MTS Univ of Alberta Lines: 32 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]) > >-- >Regards, > >Ron House. (s64421@zeus.usq.edu.au) >(By post: Info Tech, U.C.S.Q. Toowoomba. Australia. 4350) Wait a minute here. Am I missing something? Wouldn't (""?0?) be a pointer to a null (zero length) string rather than a NULL pointer (i.e. a pointer not pointing validly)? -------------------+------------------------------------------- Al Dunbar | Edmonton, Alberta | this space for rent CANADA | -------------------+-------------------------------------------