| Precedence | Operator | Description | Associativity |
|---|---|---|---|
| 1 |
() |
Function call (postfix) | Left to right |
[] |
Subscript (postfix) | ||
.
|
Member access (postfix) | ||
| 2 |
+ -
|
Unary plus and minus | Right to left |
! ~
|
Logical NOT and bitwise NOT (one's complement) | ||
| 3 |
* / %
|
Multiplication, division, and remainder | Left to right |
| 4 |
+ -
|
Addition and subtraction | |
| 5 |
<< >>
|
Bitwise left shift and right shift | |
| 6 |
< <=
|
Relational operators < and ≤ respectively | |
> >=
|
Relational operators > and ≥ respectively | ||
| 7 |
== !=
|
Equality operators = and ≠ respectively | |
| 8 | & |
Bitwise AND | |
| 9 | ^ |
Bitwise XOR (exclusive OR) | |
| 10 | | |
Bitwise OR (inclusive OR) | |
| 11 | && |
Logical AND | |
| 12 | || |
Logical OR | |
| 13 | ?: |
Ternary conditional | Right to left |