It seems you are trying to get the int i to increment, The issue you are running into is your are using a postfix operator in an expression.
When you use a postfix operator in an expression such as ( i = i++;). The returned value is the value prior to the postfix operation.
The post and prefix operators i++, ++i, essentially translate to i = i +1;
value of i:3
Hope this helps, if not clear please let me know.
(Sorry about the formatting on the code posting, for some reason the code formatting tag isnt working at the moment).
[ UD: The "Disable BB Code in this message" box was checked. ]