Seven Original Sins of K&R (Long)

Al Dunbar userAKDU at mts.ucs.UAlberta.CA
Sun Sep 30 01:25:33 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])
>
>--
>Regards,
>
>Ron House.   (s64421 at 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             |
-------------------+-------------------------------------------



More information about the Comp.lang.c mailing list