operator precedence in cpp
Operator Precedence in C++
Postfix operators:
()
,[]
,.
,->
,++
,--
Unary operators:
+
,-
,!
,~
,++
,--
,*
,&
,sizeof
,new
,delete
Multiplicative operators:
*
,/
,%
Additive operators:
+
,-
Shift operators:
<<
,>>
Relational operators:
<
,<=
,>
,>=
Equality operators:
==
,!=
Bitwise AND operator:
&
Bitwise XOR operator:
^
Bitwise OR operator:
|
Logical AND operator:
&&
Logical OR operator:
||
Conditional operator:
? :
Assignment operators:
=
,+=
,-=
,*=
,/=
,%=
,&=
,|=
,^=
,<<=
,>>=
Comma operator:
,
These rules specify the order in which operators are evaluated when they appear together in an expression.