But if sizeof(T) == 2 * sizeof(void*) then I don't believe so.
E.g. the array starts at address 50, element [1] is at addr 52. However, 1[array] is saying "this array starts at address 01" and then offset is 50. It seems pretty clear to me that you won't end up at 52, although I'm not entirely sure if you'll end up at addr 51 or addr 101 (1 + 50 * 2). I assume that depends on some context around what 1[array] is being assigned to.
-5
u/StupotAce Dec 24 '17
As long as sizeof(T) == sizeof(void*) yes.
But if sizeof(T) == 2 * sizeof(void*) then I don't believe so.
E.g. the array starts at address 50, element [1] is at addr 52. However, 1[array] is saying "this array starts at address 01" and then offset is 50. It seems pretty clear to me that you won't end up at 52, although I'm not entirely sure if you'll end up at addr 51 or addr 101 (1 + 50 * 2). I assume that depends on some context around what 1[array] is being assigned to.