Programming in C

(Barry) #1
440 Appendix A C Language Summary

An expression of any type other than voidthat identifies a data object is called an
lvalue. If it can be assigned a value, it is known as a modifiable lvalue.
Modifiable lvalue expressions are required in certain places.The expression on the
left-hand side of an assignment operator must be a modifiable lvalue. Furthermore, the
increment and decrement operators can only be applied to modifiable lvalues, as can the
unary address operator &(unless it’s a function).

5.1 Summary of C Operators


Ta b le A.5 summarizes the various operators in the C language.These operators are listed
in order of decreasing precedence. Operators grouped together have the same prece-
dence.

Ta ble A.5 Summary of C Operators
Operator Description Associativity
() Function call
[] Array element reference
-> Pointer to structure member reference Left to right

. Structure member reference



  • Unary minus



  • Unary plus
    ++ Increment
    -- Decrement
    ! Logical negation
    ~ Ones complement Right to left



  • Pointer reference (indirection)
    & Address
    sizeof Size of an object
    (type)Type cast (conversion)

  • Multiplication
    / Division Left to right
    % Modulus



  • Addition Left to right



  • Subtraction
    << Left shift Left to right


    Right shift
    < Less than
    <= Less than or equal to Left to right
    Greater than
    => Greater than or equal to






20 0672326663 AppA 6/10/04 2:01 PM Page 440

Free download pdf