The output of the following code:
is 11.Code:x = 10; x = x++; printf("%d\n",x);
What is not clear to me is: does the increment on x happen before or after the attribution? And is this considered undefined behavior?
What about "x=++x;", is it legal C or undefined behavior?
Update: Yep, looks like this is undefined behavior.