Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 beta 3/9/83; site callan.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!ihnp4!houxm!whuxl!whuxlm!akgua!sdcsvax!sdcrdcf!trwrb!scgvaxd!wlbr!callan!tim From: tim@callan.UUCP (Tim Smith) Newsgroups: net.lang.c Subject: Re: Re: C Input Question? Message-ID: <312@callan.UUCP> Date: Fri, 8-Mar-85 16:14:06 EST Article-I.D.: callan.312 Posted: Fri Mar 8 16:14:06 1985 Date-Received: Sun, 10-Mar-85 07:50:15 EST References: <1556@ritcv.UUCP> <155@cci-bdc.UUCP> <362@enmasse.UUCP> <7026@watdaisy.UUCP> Reply-To: tim@callan.UUCP (Tim Smith) Distribution: net Organization: Callan Data Systems, Westlake Village, CA Lines: 16 Summary: In article <7026@watdaisy.UUCP> ndiamond@watdaisy.UUCP (Norman Diamond) writes: >> I was reading Creative Computing when I saw the most bogus C programming >> example. The author was comparing C to Basic- >> Basic: if A=1 and B=1 goto 104950393040 [:-> >> C: if (A==1 & B==1) foobar(); >> Which works, of course, but it was clear from the context that the author >> thought that '&' and logical AND were identical!!!! -- Mark Roddy > >It doesn't work if A == 1 and B == 3. It calls foobar when it shouldn't. Mr. Roddy is correct. I think Mr. Diamond is forgetting that the range of the '==' operator is {0,1}. -- Duty Now for the Future Tim Smith ihnp4!wlbr!callan!tim or ihnp4!cithep!tim