lvalues

An lvalue is an expression that represents an object. A modifiable lvalue is an expression representing an object that can be changed. It is typically the left operand in an assignment expression. For example, arrays and const objects are not modifiable lvalues, but static int objects are.

All assignment operators evaluate their right operand and assign that value to the left operand. The left operand must evaluate to a reference to an object.

The address operator (&) requires an lvalue as an operand, while the increment (++) and the decrement (--) operators require a modifiable lvalue as an operand.

Expression Lvalue of Expression
x = 42; x
*ptr = newvalue; *ptr
a++ a

 



Overview
Operator Precedence and Associativity
Operands
Types of Expressions