For i
's of user-defined types, these operators could (but should not) have meaningfully different sematics in the context of a loop index, and this could (but should not) affect the behavior of the loop described.
Also, in c++
it is generally safest to use the pre-increment form (++i
) because it is more easily optimized. (Scott Langham beat me to this tidbit. Curse you, Scott)