Cpp - Operator Operator Precedence

Introduction

C++ Operator Precedence are listed in the following table.

Level
Operators
Evaluation Order
1 (highest)
( ) . [ ] ::
Left to right
2

* & ! ~ ++ -- + -
sizeof new delete
Right to left
Left to right
3
.* *
Left to right
4
* /
Left to right
5
+ -
Left to right
6
<< >>
Left to right
7
< <= >>=
Left to right
8
== !=
Left to right
9
&
Left to right
10
^
Left to right
11
|
Left to right
12
&&
Left to right
13
||
Left to right
14
?:
Right to left
15

= *= /= += -= %=
<<= >>= &= ^= |=
Right to left

16 (lowest)
,
Left to right