Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site umcp-cs.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!umcp-cs!chris From: chris@umcp-cs.UUCP (Chris Torek) Newsgroups: net.lang.c Subject: Re: if(p) Message-ID: <1778@umcp-cs.UUCP> Date: Tue, 8-Oct-85 03:28:00 EDT Article-I.D.: umcp-cs.1778 Posted: Tue Oct 8 03:28:00 1985 Date-Received: Thu, 10-Oct-85 06:01:53 EDT References: <1960@brl-tgr.ARPA> Organization: U of Maryland, Computer Science Dept., College Park, MD Lines: 22 > In [K&R, section] 9.3 ``the expression is 0'' cannot mean the > constant 0, but rather that the expression evaluates to zero. > There are plenty of uses of ``0'', ``zero'', and ``non-zero'' > referring to what an expression evaluates to, and only three > references that I've found (7.7, 7.13 and 7.14) to the special > meaning of the constant 0. [...] > > In Sum: it seems to me that ``if (p != NULL)'' is portable (NULL > being 0) but ``if (p)'' is not. > > Please correct me if I be wrong, before I mislead countless others. Consider yourself corrected. This rather loose definition in K&R is one of the reasons there is an ANSI standard in the works. In general, if K&R says ` is so', then you can be pretty darn sure that is so; but if they do not say ` is not', you will just have to make your best guess. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 4251) UUCP: seismo!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris@mimsy.umd.edu