The ++
s don't execute before the expression. Only ++i
executes, which indicates that the result of the expression will be 1, therefore the rest of the expression is not evaluated (short circuit).
Your code is equivalent to:
if (++i)
m = 1;
else
if (!++j)
m = 0;
else if (!++i)
m = 0;
else
m = 1;
This means that once ++i
is evaluated to true, the else
part is never executed.