Precedence
Operators--indeed, all expressions--have an inherent precedence; that
is, in the absence of explicit grouping (through parentheses), the
order of evaluation of an expression depends upon the precedence of
the elements involved. Operators of higher precedence are evaluated
before operators of lower precedence.
In the table below, elements on the same line have equal precedence.
The first two lines contain unary operators; that is, they take only
one argument. The remaining lines contain binary operators--they
take two arguments. Note that several symbols have both unary and
binary definitions.
--------------------------- Precedence -------------------------------
Operator Associativity
----------------------------------------------------------------------
identifier constant literal () [] -> . left to right
! ~ ++ -- - (type) * & sizeof right to left
* / % left to right
+ - left to right
<< >> left to right
< <= > >= left to right
== != left to right
& left to right
^ left to right
| left to right
&& left to right
|| left to right
?: right to left
= *= /= %= += -= <<= >>= &= ^= |= right to left
, left to right
----------------------------------------------------------------------
This page last updated on Fri Nov 30 10:48:32 MSK 2001
Copyright © 1992-2001, Vitaly Filatov, Moscow, Russia
Webmaster