Possible Duplicate:
In C arrays why is this true? a[5] == 5[a]
Consider the following code able to compile under VC2008.
int i = 0;
int *j = 0;
int k = 0;
i[j]; // OK?!?!
i[k]; // Compile Error.
I was wondering, what is the meaning of i[j] in this content?
i[j]equals toj[i]Therefore it’s doing
*(j + i)which is actually valid sincejis a pointer.This doesn’t apply for
kbecause it isn’t a pointer.