There was a popular myth way back in the 90's that preincrement was always faster than postincrement because the former could generate a temporary. As if this were the case:
/* x++ */
inline int postincrement(int *x) {
int temp = *x;
*x = *x + 1;
return temp;
}
/* ++x */
inline int preincrement(int *x) {
*x = *x + 1;
return *x;
}
But in typical usage, where the expression value is not used, it doesn't make any difference: for (int i = 0; i < 10; ++i) {
If one looks at the assembly, it's clearly equivalent to: for (int i = 0; i < 10; i++) {
Incidently, the latter seems more readable.