C array subscript weirdness

$ cat test.c
#include <stdio.h>

int main() {
int a[2];
a[0]=0;a[1]=0;

1[a] = 1; // weirdness

printf("%d %d\n",a[0], a[1]);
}

$ gcc -o test test.c

$ ./test
0 1

The subscript operator is commutative for what ever reason.


*(a + 1) < => a[1] < => 1[a]