You're confusing two different rule sets that deal with ordering things.
Operator precedence determines which operator in a complex expression is evaluated before the other. Multiplication takes precedence over addition, which is why 1 + 2 * 3 evaluates to 7, not to 9. Parentheses take even greater precedence, so that (1 + 2) * 3 does evaluate to 9.
Sequencing determines which operation in a program occurs first; this is not the same thing. For instance,
guarantees that its output is "ab" and not "ba", because the semicolon introduces a sequence point, across which operations may not be reordered no matter how smartly the compiler tries to optimize your program.
The semantics of pre- and post-increment
++ fall into this rule set. As a rule,
i++ guarantees that the change to the value of
i happens only after the old value has been used in computing the value of the expression where it occurs. Therefore, the expression always returns a value based on the old, lower value of
Because all of this is rather complicated, but indispensasble to create a reliable programming language, the conventional wisdom is not to use
++ and related operators with side effects within complex expressions. Even if you understand how all the rules interact, the next maintenance programmer may not, and maintainability is the second most important property of software (right behind correctness).