C operators and operands
The table below lists the C language operators in order of precedence and shows the direction of associativity for each operator. The primary operators have the highest precedence. The comma operator has the lowest precedence. Operators in the same group have the same precedence.
| Precedence level | Associativity | Operators |
|---|---|---|
| Primary | left to right | () [ ] . –> |
| Unary | right to left | ++ -- - + !
~ & * (typename) sizeof |
| Multiplicative | left to right | * ⁄ % |
| Additive | left to right | + - |
| Bitwise shift | left to right | << >> |
| Relational | left to right | < > <= >= |
| Equality | left to right | == != |
| Bitwise logical AND | left to right | & |
| Bitwise exclusive OR | left to right | ^ or ¬ |
| Bitwise inclusive OR | left to right | | |
| Logical AND | left to right | && |
| Logical OR | left to right | || |
| Assignment | right to left | = += -= *= ⁄= <<= >>= %= &= ^= |= |
| Comma | left to right | , |