Precedence ≠ order of evaluation.
The short-circuiting behavior of ||
and &&
means that their left-hand sides are evaluated first, and
- If the LHS of
||
evaluates to true (nonzero), the RHS is not evaluated (because the expression will be true
no matter what the RHS is)
- If the LHS of
&&
evaluates to false (or zero), the RHS is not evaluated (because the expression will be false
no matter what the RHS is)
In your example, ++i
gets evaluated, and is equal to -2, which is nonzero, so the right-hand side of the ||
(that is, ++j && ++k
) never gets evaluated: j
and k
are never incremented.