One of a and b must be a pointer, and the other must be any integer type. The proof follows.
Since a[b] is identical (*((a)+(b))) for C 2011 (n1570) 6.5.2.1 2, a and b can be any types for which the last expression is defined.
In 6.5.3.2, the 2 operand of the unary operator * must be of type pointer. Therefore, the result (a)+(b) must be of type pointer.
In 6.5.6, the binary + operator accepts various combinations of types, but the only one that gives the type of a pointer is a combination of a pointer and an integer, as described in 6.5.6 8.
According to 6.5.6 8, an integer can be added to the pointer, and the result is of the operand type of the pointer. In clause 6.5.6, no distinction is made about the order of operands + , so they can be in any order. Thus, any of a and b can be a pointer, and the other an integer.
source share