I have some code snippets:
int m = 4; int result = 3 * (++m);
and
int m = 4; int result = 3 * (m++);
After execution, m is 5, and the result in the first case is 15, but in the second case m is also 5, but the result is 12. Why is this? Shouldn't that be at least the same behavior?
I specifically talk about priority rules. I always thought that these rules state that parentheses take precedence over unary operators. So why is the first expression in parentheses not evaluated first?
anon
source share