| Precedence |
Operator |
Description |
Associativity |
| Highest 12 |
-> |
Structure dereference operator. |
left |
| . |
Structure reference operator. |
| 11 |
postfix ++ |
Postfix increment. |
left |
| postfix -- |
Postfix decrement. |
| 10 |
prefix ++ |
Prefix increment. |
right |
| prefix -- |
Prefix decrement. |
| unary - |
Negation operator. |
| ! |
Logical NOT. |
| & |
Address-of operator. |
| unary * |
Indirection operator. Can be applied to a variable holding a pointer. |
| 9 |
casts |
Cast operator. |
right |
| 8 |
^ |
Exponentiation operator. |
right |
| 7 |
binary * |
Multiplication operator. |
left |
| / |
Division operator. |
| % |
Modulo operator. |
| 6 |
+ |
Addition operator. |
left |
| binary - |
Subtraction operator. |
| 5 |
<= |
Relational operator "less than or equal". |
left |
| < |
Relational operator "less than". |
| >= |
Relational operator "greater than or equal". |
| > |
Relational operator "greater than". |
| 4 |
!= |
Relational operator "not equal". Can be used to compare strings. |
left |
| == |
Relational operator of equality. Can be used to compare strings. |
| 3 |
&& |
Logical AND. |
left |
| 2 |
|| |
Logical OR. |
left |
| Lowest 1 |
= |
Assignment operator. |
right |
Operator with highest precedence are evaluated first.