Different way of accessing array elements in C

Perfectly valid C. From Wikipedia:

Similarly, since the expression a[i] is semantically equivalent to *(a+i), which in turn is equivalent to *(i+a), the expression can also be written as i[a] (although this form is rarely used).

Wacky, but valid.

Leave a Comment