There is some "type of commutativity" between specifiers, as in:
int const arr[5] = { /*initial (and only) values*/};
const int arr[5] = { /* -//-*/};
where regardless of the sequence of the type name int
and const
specifier in the definition, the interpretation is the same: an array of const int
s.
Similarly, when accessing an predefined array element:
int a = arr[4];
int a = 4[arr];
there is equivalence between both ways of access.
Are there any other frequently used* similar cases?
*highly used expressions that exhibit similar behaviour and could be possibly misunderstood