Node:Unary Operator Precedence, Next:, Previous:Parentheses and Priority, Up:Expressions and operators



Unary Operator Precedence

Unary operators are operators that have only a single operand -- that is, they operate on only one object. The following are (or can be) all unary operators:

++  --  +  -

The order of evaluation of unary operators is from right to left, so an expression like:

*ptr++;

would perform the ++ before the *. (The ++ operator will be introduced in the next section, and the * operator will be introduced in the next chapter. See Pointers.)