a[b]
Is equivalent to *(a + b)
, so...
a[b & c]
Where &
has a lower operator precedence than +
, would this result in *(a + b & c)
or *(a + (b & c))
?
The C Standard, § 6.5.2.1, Array Subscripting says:
The definition of the subscript operator
[]
is thatE1[E2]
is identical to(*((E1)+(E2)))
Note the brackets surrounding E2
. The latter expression (*(a + (b & c))
) is the correct outcome.