here you should consider the operator precedence. here the expression is solved based on precedence of the operator so at a time only one associativity is applied.
The associativity comes into picture when the operator has same precedence
and in that case associativity will be same.
In your question b=a*i + ++i
i
used twice results in undefined behavoiur
.
otherwise it would be evaluated as,
++ followed by * then + operation according to precedence
.
if this was followed the the answer would be,
b=a*i + ++i
b=65*i + 0
b=65*0 + 0
b=0 + 0
b=0
but the compiler can use the stored value of i instead of using value after ++i,
b=a*i + ++i
b=a*-1 + 0
b=-65 + 0
b=-65
this results in undefined behaviour since b can be 0 or -65. and also you can see that associativity doesn't create problem while evaluating
since operators with same precedence will have same associativity
and evaluation is ordered by precedence first and within that ordered by associativity.