| Precedence |
Operator |
Description |
Associativity |
| 1 |
() |
Parentheses (function call) |
Left-to-Right |
|
[] |
Array Subscript (Square Brackets) |
|
. |
Dot Operator |
|
-> |
Structure Pointer Operator |
|
++ / -- |
Postfix increment, decrement |
| 2 |
++ / -- |
Prefix increment, decrement |
Right-to-Left |
|
+ / - |
Unary plus, minus |
|
|
! / ~ |
Logical NOT, Bitwise complement |
|
|
(type) |
Cast Operator |
|
|
* |
Dereference Operator |
|
|
& |
Addressof Operator |
|
|
sizeof |
Determine size in bytes |
|
| 3 |
* |
Multiplication |
Left-to-Right |
|
/ |
Division |
|
|
% |
Modulus |
|
| 4 |
+ |
Addition |
Left-to-Right |
|
- |
Subtraction |
|
| 5 |
<< |
Bitwise shift left |
Left-to-Right |
|
>> |
Bitwise shift right |
|
| 6 |
< |
Relational less than |
Left-to-Right |
|
<= |
Relational less than or equal to |
|
|
> |
Relational greater than |
|
|
>= |
Relational greater than or equal to |
|
| 7 |
== |
Relational is equal to |
Left-to-Right |
|
!= |
Relational is not equal to |
|
| 8 |
& |
Bitwise AND |
Left-to-Right |
| 9 |
^ |
Bitwise exclusive OR |
Left-to-Right |
| 10 |
| |
Bitwise inclusive OR |
Left-to-Right |
| 11 |
&& |
Logical AND |
Left-to-Right |
| 12 |
|| |
Logical OR |
Left-to-Right |
| 13 |
? : |
Ternary conditional |
Right-to-Left |
| 14 |
= |
Assignment |
Right-to-Left |
|
+= / -= |
Addition, subtraction assignment |
|
|
*= / /= |
Multiplication, division assignment |
|
|
%= / &= |
Modulus, bitwise AND assignment |
|
|
^= / |= |
Bitwise exclusive, inclusive OR assignment |
|
|
<<= / >>= |
Bitwise shift left, right assignment |
|
| 15 |
, |
Comma (expression separator) |
Left-to-Right |