llvvaalluuee -- Definition

An llvvaalluuee is  an expression that designates a region  of storage.  The name
comes from the assignment expression ee11=ee22;, in which the left operand must
be an lvalue.

An  identifier  has  both  an  _l_v_a_l_u_e  (its address)  and  an  _r_v_a_l_u_e  (its
contents).  Some C operators require lvalue operands; for example, the left
operand of an assignment statement  must be an lvalue.  Some operators give
lvalue results; for example, if _e  is a pointer expression, *_e is an lvalue
that designates the object to which _e points.

A  _v_a_r_i_a_b_l_e can  be used  as  an lvalue,  whereas a  constant cannot.   For
example, you cannot say

    6 = (foo+bar);

A pointer  is a variable, and  can be manipulated within  limits.  An array
name, however, is a constant and cannot be altered legally.  Thus, the code

    int foo[10];
    int *bar;
    foo = bar;

will generate an error message when you attempt to compile it, whereas

    int foo[10];
    int *bar;
    bar = foo;

will not.

The following example shows the use of both an lvalue and a rvalue:

int i, *ip;

ip = &i;   /* ip is an lvalue, i and &i are rvalues */
i = 3;     /* i is an lvalue, 3 is an rvalue */
*ip = 4;   /* *ip is an lvalue, 4 is an rvalue */

_S_e_e _A_l_s_o
PPrrooggrraammmmiinngg CCOOHHEERREENNTT, rrvvaalluuee
ANSI Standard, section 6.2.2.1
