_continue_ as NOP

Zack C. Sessions session at uncw.UUCP
Thu Feb 28 07:05:16 AEST 1991


shane at inferno.peri.com (Shane Bouslough) writes:

>Consider the following single statement while loop:

>	while ( actual work happens in here )
>		;

>I have seen _continue_ used to make the NOP semi-colon a
>little less invisible:

>	while ( actual work happens in here )
>		continue;

>What is the general consensus of this practice? Please praise,
>yawn, or flame at will.

I don't know what any accepted standard is, but my personal
preference in this type of construct is:

	while ( actual work happens in here ) ;
	next_statement;

I actually put the semi-colon on the while (or for()) on the
same line as the while (or for()). The next statement being flush
left with the previous line should be indication enough of the
structure of the code. (IMHO)

Zack Sessions
...!ecsvax!uncw!session



More information about the Comp.lang.c mailing list