What is meant by that could be a couple of things:
1) the subscript operator is defined in terms of pointer arithmetic. C99 6.5.2.1/2 "Array subscripting" says:
The definition of the subscript operator [] is that E1[E2] is identical to (*((E1)+(E2))).
As an example, assume you have an array declated like so: char s[] = "012345";
All of the following evaluate to '4':
s[4]
*(s + 4)
4[s]
- this
unusual construct might surprise you,
but because of the way that
subscripting is defined by the
standard, this is equivalent to *(4 +
s)
, which is the same as *(s + 4)
and the same as s[4]
.
2) (closely related to the above) array names evaluate to pointers to the first element of the array in most expressions (being the operand to the sizeof
operation being the main exception).