Coupon Accepted Successfully!


Lvalues (Left Values)

An expression that indicates the location is referred as lvalue and the expression that indicates the value is referred as rvalue. On left-hand side of the assignment operator (=), lvalues expression appears. Lvalues are quite often identifiers; whereas, on the right-hand side of the assignment operator (=), rvalue expression appears, which is a value to be stored at some address in memory. The set of rvalues is the subset of set of lvalues.

An lvalue is an object locator. It is an expression that points an object. An example of an lvalue expression is *k that results to a non-null pointer. A changeable lvalue is an identifier or expression that relates to an object that can be accessed and suitably modified in computer memory. A const pointer to a constant is not a changeable lvalue. A pointer to a constant can be altered (its de-referenced value cannot be altered). An lvalue could suitably stand on the left (the assignment side) of an assignment statement. Now, only changeable lvalue can legally stand on the left of an assignment statement. For example, suppose x and y are non-constant integer identifiers with appropriate allocated memory. Their lvalues are changeable. The following expressions are legal:

Rvalues (Right Values)

The statement x + y is not an lvalue, x + y = z is invalid because the expression on the left is not related to a variable. Such expressions are often called rvalues.

Test Your Skills Now!
Take a Quiz now
Reviewer Name