next up previous
Next: Statements and Control Up: C Language Reference Previous: Declarations and Definitions

Expressions and Operators

Expressions are made up of values and, optionally, operators and evaluate to values. They may take the form of:

which are evaluated as determined by the precedence and associativity of the <operator> as shown in Table gif.

  
Table: Precedence and Associativity Table

The syntax for expressions for specific operators include:

  • Assignment operator
    • <Lvalue> = <expression>

    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
      <expression>


Tep Dobry
Mon Dec 9 05:56:25 HST 1996