C bites (Null loop-bodies)

Gary M. Samuelson garys at bunker.UUCP
Wed Aug 28 01:26:09 AEST 1985


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

Comments?

Gary Samuelson



More information about the Comp.lang.c mailing list