A. M. Anisul Huq wrote:Well, this program should show error (as b is assigned 420).
Yes, but it's only assigned 420
after the statement is complete.
In order to work out what cell '
a[b]' actually refers to, the compiler must make some decision, and it makes sense for it to evaluate it
first, don't you think?
If not, feel free to explain why, and perhaps we can help you further; but it's a general truth: the expression on the
left-hand side of an assignment is always evaluated first.
HIH
Winston