| Rank | Operator | Association |
|---|---|---|
| 1 | . (struct member) |
left to right |
-> (pointer to member) | ||
func(arglist) | ||
array[index] | ||
name | ||
literal | ||
| 2 | ++ (postincrement) |
left to right |
-- (postdecrement) | ||
| 3 | * (pointer dereference) |
right to left |
& (address of) | ||
- (unary) | ||
+ (unary) | ||
! | ||
~ | ||
sizeof() | ||
++ (preincrement) | ||
-- (predecrement) | ||
| 4 | (type) (typecast) |
right to left |
| 5 | * |
left to right |
/ | ||
% | ||
| 6 | + |
left to right |
- | ||
| 7 | << (left shift) |
left to right |
>> (right shift) | ||
| 8 | < |
left to right |
> | ||
<= | ||
>= | ||
| 9 | == |
left to right |
!= | ||
| 10 | & (bitwise AND) |
left to right |
| 11 | ^ (bitwise XOR) |
left to right |
| 12 | | (bitwise OR) |
left to right |
| 13 | && (boolean AND) |
left to right |
| 14 | || (boolean OR) |
left to right |
| 15 | expr ? expr : expr |
right to left |
| 16 | = |
right to left |
*= | ||
/= | ||
%= | ||
+= | ||
-= | ||
<<= | ||
>>= | ||
&= | ||
^= | ||
|= | ||
| 17 | , (sequential evaluation) |
left to right |