Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!rutgers!njin!princeton!phoenix!tbrakitz From: tbrakitz@phoenix.Princeton.EDU (Triantaphyllos Byron Rakitzis) Newsgroups: comp.lang.c Subject: Re: A question of style Message-ID: <11874@phoenix.Princeton.EDU> Date: 2 Dec 89 08:03:34 GMT References: <547@mars.Morgan.COM> <1989Nov30.001947.14883@aqdata.uucp> <427@jhereg.Minnetech.MN.ORG> Organization: Princeton University, NJ Lines: 29 In-reply-to: mark@jhereg.Minnetech.MN.ORG's message of 1 Dec 89 14:56:17 GMT >>while (c = getchar(), c != EOF) >>{ > >The code above could be written as > > while (c = getchar && c != EOF) { Mark H. Colburn mark@Minnetech.MN.ORG Open Systems Architects, Inc. No!! What if getchar returns the null character? Then this test fails. The usual C syntax for the above statement is while ((c = getchar()) != EOF) { blah blah; Okay? -- "C Code." "C Code run." "Run, Code, run!" Byron Rakitzis. (tbrakitz@phoenix.princeton.edu ---- tbrakitz@pucc.bitnet)