C++ Tutorials

C++ Tutorials

Operator Associativity
() [] . -> expr++ expr– left-to-right
* & + – ! ~ ++expr –expr (typecast) sizeof right-to-left
* / % left-to-right
+ – left-to-right
>> << left-to-right
< > <= >= left-to-right
== != left-to-right
& left-to-right
^ left-to-right
| left-to-right
&& left-to-right
|| left-to-right
?: right-to-left
= += -= *= /= %= >>= <<= &= ^= |= right-to-left
, left-to-right<

Order of Operation : PEMDAS

  • Parenthesis
  • Exponents
  • Multiplication
  • Division
  • Addition
  • Subtraction