3 ms·
The example you gave is actually different code and are not directly comparable. With i = 0; x = array[i++] will access the first element, x = array[++i] will a
by daemin 10y ago
The example you gave is actually different code and are not directly comparable. With i = 0; x = array[i++] will access the first element, x = array[++i] will access the second element. So of course in the second case the array load will wait until it gets the incremented value.
Edit: The same code with a preincrement notation would be x = array[i]; ++i;
- ifdefdebug 10y agoThe cited statement accounts for this: > Obviously, the initial value of i must be adjusted > if you change pre-increment to post-increment.
- deleted 10y ago[deleted]