i = i++ - do this:
int old_i = i; i = i + 1; i = old_i;
What actually happens is that the i++ value is the value of i until the increment occurs, then i will get the value .. i .
In one line of i++ , the old value of i will be used, and then it will increase it.
source share