Path: utzoo!attcan!uunet!know!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!uflorida!ziggy!screamer!tscs!tct!chip From: chip@tct.uucp (Chip Salzenberg) Newsgroups: comp.unix.sysv386 Subject: Re: "p ? a : b" Keywords: NULL Message-ID: <270751E3.55EB@tct.uucp> Date: 1 Oct 90 14:25:38 GMT References: <1990Sep21.143435.9810@dce.ie> <143@guug.guug.de> Followup-To: comp.lang.c Organization: Teltronics/TCT, Sarasota, FL Lines: 20 According to ott@guug.guug.de (Joachim Ott Munich-Germany): >In article , em@dce.ie (Eamonn McManus) writes: >> /* The stupid Microsoft compiler warns about the ?: below. Ignore it. >> Better still, use GNU C. */ >> su(pwd, login, shell ? shell : pwd->pw_shell, argv + i - 1); > >Not really stupid (i must admit to microsoft). 'shell ?' means >'shell != 0' and *not* 'shell != NULL'. You should not rely on >NULL being the same as 0. It is true that NULL is not always defined literally as "0". However, "pointer != NULL" and "pointer != 0" are equivalent. The quoted C statement is portable and correct. Further discussion should take place in comp.lang.c. (Anyone who disagrees with my statement above should read the Frequently Asked Questions article in comp.lang.c before posting.) -- Chip Salzenberg at Teltronics/TCT ,