i++ means "tell me the value of i and then increment it"
++i means "increment i and then tell me the value"
In both cases the variable is incremented, they are pre-increment, post-increment operators. If you take the value of both expressions in exactly the same cases, the result will differ...