Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!ames!ucbcad!ucbvax!ulysses!hector!jss From: jss@hector.UUCP Newsgroups: news.software.b,comp.lang.c Subject: Re: News for Xenix on PC AT ? Message-ID: <2440@ulysses.homer.nj.att.com> Date: Thu, 23-Apr-87 12:23:53 EST Article-I.D.: ulysses.2440 Posted: Thu Apr 23 12:23:53 1987 Date-Received: Sat, 25-Apr-87 05:22:17 EST References: <18346@ucbvax.BERKELEY.EDU> <145@sds.UUCP> <17005@sun.uucp> <146@sds.UUCP> Sender: daemon@ulysses.homer.nj.att.com Reply-To: jss@hector (Jerry Schwarz) Organization: AT&T Bell Labs, Murray Hill Lines: 18 Xref: utgpu news.software.b:506 comp.lang.c:1791 In article <146@sds.UUCP> dave@sds.UUCP writes: > >Why is "if (charptr == 0)" NOT identical to "if ((int)charptr == 0)" ??? Because the language definition says it isn't. The relevant paragraphs of K&R and ANSI proposal (I don't have H&S at hand) K&R: A pointer may be compared to an integer, but the result is machine dependent unless the integer is the constant 0. A pointer to which 0 has been assigned is guaranteed not to point to any object and will appear to be equal to 0 ... ANSI: An integral constand expression with the value 0, or such an expression cast to type void *, is called a null pointer constant. If a null pointer constant is assigned to or compared for equality to a pointer, the constant is converted to a pointer of that type ... Jerry Schwarz