i = ++i;
invokes Undefined Behaviour whereas ++i;
does not.
C++03 [Section 5/4] says Between the previous and next sequence point a scalar object shall have its stored value modified at most once by the evaluation of an expression
.
In i = ++i
i
is being modified twice[pre-increment and assignment] without any intervening sequence point so the behaviour is Undefined in C as well as in C++.
However i = ++i
is well defined in C++0x :)