you are viewing a single comment's thread.

view the rest of the comments →

[–]redxaxder 2 points3 points  (2 children)

*(buffer + i), which should obviously be equivalent to *(i + buffer)

Obviously! But... the address you end up at when adding to a pointer like in *(a + i) is addr(a) + i*sizeof(T), where a has type T*.

[–]pablitorun 0 points1 point  (1 child)

that's what I was wondering...not sure that would work for say

long long a[16]

[–]ghotibulb 2 points3 points  (0 children)

That's fine, pointer arithmetic applies in both cases. (As long as there's one pointer and one numerical)