Postfix grammar of an expression from the C11 standard:
postfix-expression: primary-expression postfix-expression [ expression ] postfix-expression ( argument-expression-listopt ) postfix-expression . identifier postfix-expression -> identifier postfix-expression ++ postfix-expression -- ( type-name ) { initializer-list } ( type-name ) { initializer-list , }
Grammar of the primary expression from the C11 standard:
primary-expression: identifier constant string-literal ( expression ) generic-selection
And so on. 5 is an integer constant, therefore 5 [a] correspond to this:
postfix-expression [ expression ]
Hope this is what you mean.
EDIT: I forgot to mention this, but other comments have already been made:
One of the expressions must have a type pointer '' to complete the type of the object, and the other expression must have an integer type, and the result is of type type.
In this "integer type" he needed to prohibit indexing of floating point constants.
source share