Possible Duplicate:
Could anyone explain these undefined behaviors (i = i++ + ++i , i = i++, etc…)
increment values in printf
I have a two double arrays x and y and integer i. My question is whether the statement:
double res = x[i] * y[i++];
is always equal to the statement:
double res = x[i] * y[i];
i++;
Is it possible that some compilers would change x[i] * y[i++] into y[i++] * x[i], which obviously produces different result?