Originally Posted by
Vespasian_2
I understand. Is there any design rationale behind this (Edit: I mean why was the language designed like this)? If you could evaluate an array name to a modifiable address, you would only lose the reference to the original element which isn't a disaster.
This is true for every variable.
Code:
int a; \\a particular memory slot is set aside for a
int *b = &a; \\b can be set to point wherever you want it to point
&a = &b; \\ERROR: can't move actual variable a
&b = b + 1; \\ERROR: can't move actual variable b
b = b + 1; \\fine: changes the value of b so it points to the "next" memory space.
There's no reason to believe that your variables live in places that have addresses, necessarily.