We have a FAQ on this exact topic found here.
but it boils down to this:
evaluate the expression "i". it is 0.
increment i. It is now 1.
now assign what we evaluated earlier to what is on the left side of the "=". that was 0, so assign 0 to i, erasing whatever was there.