a.b[i]
is the same thing as (a.b)[i]
?Here a is a structure and b is his member (b is an array or a pointer).
I read an article about precedence of c operators just now and it told me that the [ ] (brackets) operator is prior to the .(point), and the associativity of these two c operators is left-to-right :
a.b.c[i].d[j]
Operators .
and []
have the same precedence, and are evaluated from left-to-right. The expression a.b[i]
is the same as (a.b)[i]
The expression a.b.c[i].d[j]
is evaluated as: ((((a.b).c)[i]).d)[j]