Possible Duplicate:
In C arrays why is this true? a[5] == 5[a]
This question asks why
a[5] == 5[a]
It is answered in all aspects except one...
Why is one allowed to put an array subscript after an integer in the first place? And why isn't one allowed to write something like
[a]5
or
[5]a
or put []
in some other odd place?
In other words, what is the definition of where an array index operator is allowed?
EDIT I: The answers I received that quote the the standard were a little hard to grasp at first. But with the help of the responders I now understand. An array subscript (a square bracket) is allowed after a pointer or an integer. If it follows a pointer, what's inside the brackets must be an integer. If it follows an integer, what's inside the brackets must be a pointer.
I'm accepting the less upvoted answer because he did a bit more hand-holding in getting me to understand the quote from the standard. But the answer that strictly quotes the standard is correct too. It was just harder to understand at first.
EDIT II: I do not think my question was a duplicate. My question was about the allowed grammar regarding the array subscript operator. It was answered by quotes from the standard that never appear in the question I supposedly duplicated. It is similar, yes, but not a duplicate.