4 ms·
But the combined expression solves exactly your problem! You were not sure whether the increment would always happen before the assignment. In the combined exp
by vog 16y ago
But the combined expression solves exactly your problem!
You were not sure whether the increment would always happen before the assignment. In the combined expression you can simply use the pre-increment operator, which will always increment before the rest of the expression.
It's shorter, unambiguous and leaves less questions. How can something be any "cleaner" than that?
Also, the statements "array[index++]" and "array[++index]" are pretty well-understood idioms in C.