filmov
tv
Array Subscript Operator Commutativity in C

Показать описание
Arrays are a fundamental part of the C programming language. An array represents an arrangement of objects which in C is represented as a pointer.
v[7] notation is syntactic sugar which translates to *(v+7). In a similar manner, 7[v] translates to *(7+v). Since "+" operator is commutative, they are equivalent.
v[7] notation is syntactic sugar which translates to *(v+7). In a similar manner, 7[v] translates to *(7+v). Since "+" operator is commutative, they are equivalent.