Say you have the declaration
int foo[42];
The declarator part is foo[42]
. Whenever something of same form (ie foo
followed by [
followed by an expression followed by ]
) appears within an expression (and the delaration is in scope), the type of that sub-expression will be of the declared type int
.
To put it another way: As far as syntax goes, a declaration like
int *bar;
does not declare bar
to be of type int *
, but instead declares *foo
to be of type int
.
For a more involved example, take the declaration
float (*op[42])(float, float);
In an expression, an operand of same form could look like this
c = (*op[i])(a, b);
According to the quotation, the right-hand side would have type float
.
This implies that
*op[i]
must have function type (we ignore the fact that function designators decay to corresponding pointer types and function invocation via postfix ()
actually works on pointers, not designators).
This in turn implies that
op[i]
must denote a function pointer and we finally arrive at
op
denoting an array of function pointers as that's what we can apply postfix []
on and get back the correct type.
Fun, isn't it ;)