i++ or ++i
/*************** In for Loop ***************/
// You'd better always use ++i.
// Since the logic is the same while i++ needs to save old value before increment which may increase overhead;
// Compiler optimization may optimize i++, but may not be always the case.
/******** For assignment operations ********/
// The logic are different, decide on the logic you write.
// x += ++i will increment i and add i+1 to x.
// x += i++ will add i to x, then increment i.