Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Appendix B. Operator Precedence

Appendix B. Operator Precedence

C++ Operator Precedence
Precedence LevelOperatorDescription
17::Scope resolution
16->Indirect member selection
16.Member selection
16[ ]Array index
16( )Function call
16( )Type construction
16sizeofSize in bytes
15++Increment
15- -Decrement
15~Bitwise NOT
15!Logical NOT
15+Unary plus
15-Unary minus
15*Dereference
15&Address-of
15( )Cast
15newAcquire memory on the heap
15deleteRelease memory on the heap
14->*Indirect member pointer selector
14.*Member pointer selector
13*Multiplication
13/Division
13%Modulus
12+Addition
12-Subtraction
11<<Bitwise shift left
11>>Bitwise shift right
10<Less than
10<=Less than or equal to
10>Greater than
10>=Greater than or equal to
9==Equal to
9!=Not equal to
8&Bitwise AND
7^Bitwise XOR
6|Bitwise OR
5&&Logical AND
4||Logical OR
3?:Conditional operator
2=Assignment
2*=Multiply and assign
2/=Divide and assign
2%=Modulus and assign
2+=Add and assign
2-=Subtract and assign
2<<=Bitwise shift left and assign
2>>=Bitwise shift right and assign
2&=Bitwise AND and assign
2|=Bitwise OR and assign
2^=Bitwise XOR and assign
1,Comma operator



  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial