This is undefined behavior in C++ and you should never write code like this, and do not bother to make sense of the compiler's output, it's a waste of time.
It boils down to "unsequenced multiple modifications" to the same memory location n, i.e. they can happen in any order.
P.S. Always add -Wall when compiling with gcc.
Luke Li
Programmer
This is undefined behavior in C++ and you should never write code like this, and do not bother to make sense of the compiler's output, it's a waste of time.
It boils down to "unsequenced multiple modifications" to the same memory location
n, i.e. they can happen in any order.P.S. Always add
-Wallwhen compiling with gcc.