Path: utzoo!mnetor!motto!andrew From: andrew@motto.UUCP (Andrew Walduck) Newsgroups: comp.lang.c Subject: Portable NULL pointers Message-ID: <237@motto.UUCP> Date: 27 Sep 90 17:42:46 GMT Lines: 21 goudreau@dg-rtp.dg.com (Bob Goudreau) writes: >> The Second Original Sin was the failure to make "NULL" a keyword. roy@phri.UUCP (Roy Smith) writes: >What about this for a portable way to define NULL: >#define NULL (""[1]) >would that work? No...it would probably generate a nice segment violation as it read off the end of the array! ;-) Try: (""[0]) or even ([0]"") or *("") (some of these almost look like ;-) As for portabilty, well, thats why we use #include . If NULL in there breaks something...well either fix the code, or the compiler. Please, don't use your own "portable" versions of NULL as sooner or later it will break somewhere! And someone (like me) will curse you! ;-) ;-) Andrew Walduck andrew@motto.UUCP (keep trying the mailer is magic!)