As I stated in my comment , there is no sequence point ...
According to ยง6.2.2 Stroustrup C ++ programming language, third edition ...
The procedure for evaluating subexpressions in an undefined expression. In particular, you cannot assume that an expression evaluates from left to right.
& sect; 5.4 of the C ++ 03 standard indicates:
Except where noted, the procedure for evaluating the operands of individual operators and the subexpressions of individual expressions and the order in which side effects occur are not defined. Between the previous and the next point in the sequence, the scalar object must have a value that its value is stored no more than once by calculating the expression.
You can learn more about sequence points and undefined behavior here .
oldrinb
source share