The major theme of this lecture was to develop a good understanding of the meaning and use of the assignment operator =. The text gives a very brief explanation of this in Ch. 2.5. However we feel that this is an important issue that deserves more discussion.
When using a statement such as
x = y+2;it is important to understand its effect.
In generally, the computer does the following when faced with such an assignment.
It evaluates the current value of the expresison on the right-hand side of the = operator.
After computing the so-called rvalue it then stores that value into the memory location associated with the left-hand side of the statement (the so-called lvalue).