UMBC CMSC 201 & 201H Fall '98 | CSEE | 201 | 201 F'98 | lectures | news | help |
A variable can appear on both the left hand side and the right hand side of an assignment operator, thus it has an lvalue and an rvalue.
thisOne = thatOne;thisOne is taken as the address of the variable whereas thatOne is taken as the value of the variable.
The lvalue must therefore yield a location, usually a reference to a variable and the rvalue can be any expression that yields a value.
answer = (average + 5) * 2;You can also have certain expressions as an lvalue such as when you obtain an array's element by subscripting.
array[i] = i * i;