Here is a table of the C language's operator precedence. However, some easy-to-remember rules of thumb are:
Note: Higher-precedence operators are toward the top of the table; lower-precedence operators are toward the bottom.
Operators | Associativity |
() [] -> . | left to right |
! ~ ++ -- unary+ unary- unary* & (type) sizeof | right to left |
binary* / % | left to right |
binary+ binary- | 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 |