comma operator

Paul Reger paulr at sequent.UUCP
Fri Aug 18 07:43:47 AEST 1989


Considering the construction:

while ((ch = getchar()) != EOF && ch != '\n')

Is there any assurance in any C standard that the left expression will
always be evaluated first, with the right following it ??  I mean for
purposes of optimization, the right should be evaluated first, unless
there is something in some standard somewhere limiting such
optimizations...

I'm from Ada-land where such problems are handled by the 'and then'
clause.

Anybody know ???



More information about the Comp.lang.c mailing list