| ▲ | crote 2 hours ago | |||||||||||||||||||||||||||||||
The horrifying side effect of this is that "arr[idx]" is equal to "idx[arr]", so "5[arr]" is just as valid as "arr[5]". Your colleagues would probably prefer if you forget this. | ||||||||||||||||||||||||||||||||
| ▲ | miningape 2 hours ago | parent | next [-] | |||||||||||||||||||||||||||||||
Mom, please come pick me up. These kids are scaring me. | ||||||||||||||||||||||||||||||||
| ▲ | Joker_vD 2 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
> so "5[arr]" is just as valid as "arr[5]" This is, I am sure, one of the stupid legacy reasons we still write "lr a0, 4(a1)" instead of more sensible "lr a0, a1[4]". The other one is that FORTRAN used round parentheses for both array access and function calls, so it stuck somehow. | ||||||||||||||||||||||||||||||||
| ▲ | rocqua 2 hours ago | parent | prev [-] | |||||||||||||||||||||||||||||||
That depends on sizeof(*arr) no? | ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||