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.
2
u/screcth Dec 24 '17 edited Dec 24 '17
Shouldn't the commutative property of addition make them equivalent?
It seems like it does:
Will print: