Because x[y]
is equivalent to *(x + y)
.
a[2] = *(a + 2) = *(2 + a) = 2[a]
Last edited on
That's great, @Peter87! (And thanks for re-editing.)
With your pointer arithmetic I can now see the logic - but I don't think I would dare use that form in my own code.
Thanks.
Last edited on