I have the following code:
int x,y,z;
x=1;y=1;z=1;
++y+=x+y+z;
cout<<y; // returns 6
x=1;y=1;z=1;
++y+=x+y+z++;
cout<<y; //returns 5
Is this undef behavior? In the 2nd example the right side is evaluated first and then the prefix of the left side. If it's not undef behavior can you please point to the precedence/evaluation rule where this belongs.