C Input Question?

Norman Diamond ndiamond at watdaisy.UUCP
Mon Mar 4 07:13:57 AEST 1985


> 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.

-- 

   Norman Diamond

UUCP:  {decvax|utzoo|ihnp4|allegra}!watmath!watdaisy!ndiamond
CSNET: ndiamond%watdaisy at waterloo.csnet
ARPA:  ndiamond%watdaisy%waterloo.csnet at csnet-relay.arpa

"Opinions are those of the keyboard, and do not reflect on me or higher-ups."



More information about the Comp.lang.c mailing list