Possible Duplicate:
Undefined Behavior and Sequence Points
What will the value of x in following line of code:- x = a++ + ++a + a++ actually compiler is giving x = 3..but how????
Possible Duplicate:
Undefined Behavior and Sequence Points
What will the value of x in following line of code:- x = a++ + ++a + a++ actually compiler is giving x = 3..but how????
This is undefined behavior. Any answer is valid, up to and including crashing. It is unlikely that any particular answer will be consistent between platforms. Don't do this.
Undefined behavior, as the value of a
is modified multiple time in the same statement.