2 ms·
As RegEx implies, pointer arithmetic implicitly includes the sizeof(<array type>) term, i.e. given int* array; then array + 1 points to the next int, no
by dbaupp 14y ago
As RegEx implies, pointer arithmetic implicitly includes the sizeof(<array type>) term, i.e. given
int* array;
then
array + 1
points to the next int, not the next byte. And so array[2] == *(array + 2). (The fact that addition commutes means that using 2[array] instead is valid and works in C.)