a[j]==j[a]

bjarne

So I have read some 12% of the book now. One of the things of interest was that a[j]==j[a], which is described in 7.4.1 Navigating Arrays.

For example, “jh1ood”[2] is the second, or if you start counting from one, the third character of the string “jh1ood”, and therefore is ‘1’. But, the story continues that 2[“jh1ood”] is also ‘1’.

a[0] = 10
a[1] = 11
a[2] = 12
a[3] = 13
a[4] = 14

2[a] = 12

The proof is as follows:

a[j] == *(&a[0]+j) == *(a+j) == *(j+a) == j[a]