Expressions
Objects and lvalues
An object
is a manipulatable region of storage.
An lvalue
is an expression referring to an object.
An obvious example of an lvalue
expression is an identifier.
There are operators that yield lvalues:
for example,
if E
is an expression of pointer type, then
*E
is an lvalue
expression referring to the object to which
E
points.
An lvalue is
``modifiable''
if:
-
it does not have array type,
-
it does not have an incomplete type,
-
it does not have a const-qualified type,
and, if it is a structure or union,
it does not have any member
(including, recursively, any member of all
contained structures or unions)
with a const-qualified type.
The name ``lvalue'' comes from the assignment expression
E1 = E2
in which the left operand
E1
must be
an lvalue expression.
Primary expressions
-
Identifiers, constants, string literals,
and parenthesized expressions are primary expressions.
-
An identifier is a primary expression,
provided it has been declared as designating
an object (which makes it an lvalue)
or a function (which makes it a function designator).
-
A constant is a primary expression; its type depends
on its form and value.
-
A string literal is a primary expression; it is an lvalue.
-
A parenthesized expression is a primary expression.
Its type and value are identical to those
of the unparenthesized version.
It is an lvalue, a function designator,
or a void expression, according to the type
of the unparenthesized expression.
-
A compound literal takes the form (type){init-list}.
It behaves in the same way as an object of the specified type, with a value
provided by the initialization list.
Next topic:
Operators
Previous topic:
Usual arithmetic conversions
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005