precedence Definition precedence
Precedence refers to the property of each C operator that deter-
mines priority of execution. Operators are executed in order of
their degree of precedence, from highest to lowest.
The following table summarizes the precedence of C operators.
The are listed in descending order of precedence: those listed
higher in the table are executed before those lower in the table.
Operators listed on the same line have the same level of
precedence.
Operator Associativity
___________________________________________
() [] -> . Left to right
___________________________________________
! ~ ++ -- - (type) * & sizeofRight 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
___________________________________________
You can always determine precedence in an expression by enclosing
sub-expressions within parentheses: the expression enclosed
within the innermost parentheses is always executed first.
***** See Also *****
definitions, operators
The C Programming Language, ed. 2, page 48
COHERENT Lexicon Page 1