An expression that identifies a memory space that holds a value is called an lvalue, because it is a location that can hold a value.
The standard kinds of lvalues are:
If an expression’s outermost operation is any other operator, that
expression is not an lvalue. Thus, the variable x
is an
lvalue, but x + 0
is not, even though these two expressions
compute the same value (assuming x
is a number).
It is rare that a structure value or an array value is not an lvalue, but that does happen—for instance, the result of a function call or a conditional operator can have a structure or array type, but is never an lvalue.
If an array is an lvalue, using the array in an expression still
converts it automatically to a pointer to the zeroth element. The
result of this conversion is not an lvalue. Thus, if the variable
a
is an array, you can’t use a
by itself as the left
operand of an assignment. But you can assign to an element of
a
, such as a[0]
. That is an lvalue since a
is an
lvalue.