Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site cubsvax.UUCP Path: utzoo!linus!philabs!cmcl2!rna!cubsvax!peters From: peters@cubsvax.UUCP (Peter S. Shenkin) Newsgroups: net.lang.c Subject: Re: condition convention 'if (10 == j)...' Message-ID: <333@cubsvax.UUCP> Date: Mon, 29-Apr-85 23:44:14 EDT Article-I.D.: cubsvax.333 Posted: Mon Apr 29 23:44:14 1985 Date-Received: Wed, 1-May-85 06:15:28 EDT References: <137@bocklin.UUCP> <> <332@cubsvax.UUCP> <> Reply-To: peters@cubsvax.UUCP (Peter S. Shenkin) Organization: Columbia Univ Biology, New York City Lines: 16 Summary: In article <> oacb2@ut-ngp.UUCP writes: >> Just that instead of writing, in the traditional manner, >> if(pc=malloc(nbytes)==NULL)... >> you have to insert extra parens if you use the other form: >> if(NULL==(pc=malloc(nbytes))).. > >Huh??? The first sets pc to 0 or 1 depending on whether the result of >malloc is or is not NULL. The second sets pc to the result of malloc. > > Mike Rubenstein, OACB, UT Medical Branch, Galveston TX 77550 As the contributor of this chestnut ( marked >> ), I acknowledge the egg on my face. Guess that's not why I stopped using "if(CONST==var)..." after all (At least I hope not! :-) ). -P. Shenkin (And also thanks to those who pointed out my error via mail.)