A question of style

Doug Gwyn gwyn at smoke.BRL.MIL
Fri Dec 1 10:35:03 AEST 1989


In article <1989Nov30.001947.14883 at aqdata.uucp> sullivan at aqdata.uucp (Michael T. Sullivan) writes:
>From article <547 at mars.Morgan.COM>, by amull at Morgan.COM (Andrew P. Mullhaupt):
>> ...I can't think of what I would call a 'proper' use of the comma operator...

Mostly it finds use within fancy macros.

>while (c = getchar(), c != EOF)

The standard C idiom for this is
	while ( (c = getchar()) != EOF )
and experienced C programmers are likely to read the standard idiom
with greater facility than your proposed use of a comma operator for this.



More information about the Comp.lang.c mailing list