18.4.10 Priority of operators
The priority and linking order of operators affect operand grouping and evaluation for expressions. The priority of operators is meaningful only when there are operators with different priorities in the same expression. If the expression contains a higher-priority operator, the operator is evaluated first. If operators have the same priority, the order in which to evaluate them depends on their linking order.
The following table shows the priority and linking order of the operators. The following arrangement shows the operators in descending priority order.
Symbol |
Operator |
Linked: |
---|---|---|
( ) |
Parentheses |
From the left to the right |
+ - ! |
Unary operators |
From the right to the left |
* / % |
Multiplying operators |
From the left to the right |
+ - |
Adding operators |
From the left to the right |
< > <= >= |
Comparison operators |
From the left to the right |
== != |
Equality |
From the left to the right |
& |
Bitwise AND |
From the left to the right |
| |
Bitwise OR |
From the left to the right |
&& |
Logical AND |
From the left to the right |
|| |
Logical OR |
From the left to the right |
= |
Assignment |
From the left to the right |