Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site rpics.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!rpics!weltyrp From: weltyrp@rpics.UUCP (Richard Welty) Newsgroups: net.lang.c Subject: Re: Re: Re: C bites (Null loop-bodies) Message-ID: <176@rpics.UUCP> Date: Fri, 30-Aug-85 20:18:52 EDT Article-I.D.: rpics.176 Posted: Fri Aug 30 20:18:52 1985 Date-Received: Mon, 2-Sep-85 04:09:33 EDT References: <165@3comvax.UUCP> <418@phri.UUCP> <958@bunker.UUCP> Distribution: net Organization: RPI CS Department, Troy NY Lines: 37 > > I put null loop-bodies on a separate line like in the following > > example. > > > > while (eatup() != '\n') > > ; > > Putting the semi-colon on a separate line does help make it clear > that the body of the loop is intentionally null, but what I like > even better is: > > while( eatup() != '\n' ) > continue; > I personally like to use {} in all cases ... thus: while( eatup() != '\n'){} or while( eatup() != '\n') {} or even while( eatup() != '\n') { } By using the {} all the time, even for null cases, I insure that things like if( cond); don't happen ... -- Rich Welty (I am both a part-time grad student at RPI and a full-time employee of a local CAE firm, and opinions expressed herein have nothing to do with anything at all) CSNet: weltyrp@rpi ArpaNet: weltyrp.rpi@csnet-relay UUCP: seismo!rpics!weltyrp