4.1.6
Operator Evaluation Order
When an expression includes multiple operators, the evaluation order of these operators is determined according to the precedence and the associativity indicated by right or left.
Table 3.19 shows each operator precedence and associativity.
Table 4.5 | Operator Precedence and Associativity |
|
|
|
|
1
|
++ -- (postfix) ( ) [ ] -> .
|
Left
|
Postfix expression
|
2
|
++ -- (prefix) ! ~ + - * & sizeof
|
Right
|
Unary expression
|
3
|
(Type name)
|
Right
|
Cast expression
|
4
|
* / %
|
Left
|
Multiplicative expression
|
5
|
+ -
|
Left
|
Additive expression
|
6
|
<< >>
|
Left
|
Bitwise shift expression
|
7
|
< <= > >=
|
Left
|
Relational expression
|
8
|
== !=
|
Left
|
Equality expression
|
9
|
&
|
Left
|
Bitwise AND expression
|
10
|
^
|
Left
|
Bitwise exclusive OR expression
|
11
|
|
|
Left
|
Bitwise inclusive OR expression
|
12
|
&&
|
Left
|
Logical AND operation
|
13
|
||
|
Left
|
Logical inclusive OR expression
|
14
|
?:
|
Right
|
Conditional expression
|
15
|
= += -= *= /= %= <<= >>= &= |= ^=
|
Right
|
Assignment expression
|
16
|
,
|
Left
|
Comma expression
|