Next: Statements and Control
Up: C Language Reference
Previous: Declarations and Definitions
Expressions are made up of values and, optionally, operators and
evaluate to values. They may take the form of:
-
Constant
which include numeric constants expressed in decimal, octal,
or hexadecimal; character constants; or string constants.
-
Variable name
which evaluates to the value stored in the variable cell.
-
Function call
- <identifier>( <expression< [,<expression
])
which evaluate to the return value of the function.
-
Operator expression
- [(] [<expression
operator> <expression> [)]
which are evaluated as determined by the precedence and associativity
of the <operator>
as shown in Table
.
Table: Precedence and Associativity Table
The syntax for expressions for specific operators include:
-
Assignment operator
where <Lvalue> may be and expression that evaluates to
a reference to a storage cell, such as a variable name,
<identifier>, or a dereferenced pointer, *<identifier>.
-
Cast operator
- (<type-specifier>) <expression>
-
Auto increment and decrement operators
- ++ <Lvalue>
- -- <Lvalue>
- <Lvalue> ++
- <Lvalue> --
-
Compound assignment operators
- <Lvalue> <op>= <expression>
-
Conditional operator
- <expr1> ? <expr2> : <expr3>
-
Comma operator
- <expression1> , <expression2>
-
sizeof operator
Tep Dobry
Mon Dec 9 05:56:25 HST 1996