Mail Archives: djgpp/1997/03/30/02:54:48
shearer AT pluto DOT njcc DOT com wrote:
> the following, compiled and run under djgpp(gcc272),
> with the condition of the for loop being ++i or i++,
> seems to result in the same for both cases.
>
> such shouldn't be the case, should it?
No, it's correct. The increment field of the for statement (e.g., the ++i
or i++) is executed after each iteration but the value is not used for
anything; only the side effects of this statement, if any, are significant.
Thus whether you choose to use postfix increment or prefix increment is
unimportant, since the evaluation of the expression is not important, just
the side effects that expression has (namely, incrementing i).
--
Erik Max Francis, &tSftDotIotE / email: max AT alcyone DOT com
Alcyone Systems / web: http://www.alcyone.com/max/
San Jose, California, United States / icbm: 37 20 07 N 121 53 38 W
\
"I am become death, / destroyer of worlds."
/ J. Robert Oppenheimer (quoting legend)
- Raw text -