comma operator

Peter da Silva peter at ficc.uu.net
Mon Aug 7 22:22:18 AEST 1989


In article <1938 at softway.oz>, stephenf at softway.oz (Stephen Frede) writes:
> 	while ( printf("enter a number: "), scanf("%f", &num) == 1 )
> 	    ...	/* calculations on num */

Only because C doesn't have a general looping construct. I once
suggested this syntax:

	[do
		statement]
	[while(expr)
		statement]

Which includes both standard do...while, and while. Unfortunately it's
also even more susceptible to typos than regular do...whiles, so I got
roundly rejected.
-- 
Peter da Silva, Xenix Support, Ferranti International Controls Corporation.
Business: peter at ficc.uu.net, +1 713 274 5180. | "The sentence I am now
Personal: peter at sugar.hackercorp.com.   `-_-' |  writing is the sentence
Quote: Have you hugged your wolf today?  'U`  |  you are now reading"



More information about the Comp.lang.c mailing list