4 ms·
Sequence point ordering is not relevant to the example code (assuming of course that there are no macros involved here): data[index++] += 'a'; All that matt
by caf 8y ago
Sequence point ordering is not relevant to the example code (assuming of course that there are no macros involved here):
data[index++] += 'a';
All that matter is what the ++ operator evaluates to - the sequencing of the side-effect modification to 'index' is irrelevant. The ++ operator evaluates to the value of 'index' before the increment is applied, so we know that the is array location which will be modified.
As it happens, in C the modifications to the location in the 'data' array and the 'index' variable are not sequenced relative to each other, but that is not observable.