|
|
>> If L=1 then a[b] == b[a].
>
> Uh, how do you figure? The memory locations of the two variables might
> be in no way related.
"a" is a pointer-to type, "b" is an integer type.
a[b] just means read the memory at location a+b. The "+" operator
doesn't care which way round the variables are. Also thinking about it,
this probably works for any array type, as the "+" operator knows how to
add an integer to a pointer-to type in general (it multiplies the
integer by the size of each array element first).
Post a reply to this message
|
|