0% found this document useful (0 votes)
19 views

Appendix A

The document discusses operator precedence in C++. It states that operators have a precedence order in which they are evaluated in a formula. Higher precedence operators are evaluated first, even if they appear later in the formula. It provides a table that lists C++ operators from highest to lowest precedence.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Appendix A

The document discusses operator precedence in C++. It states that operators have a precedence order in which they are evaluated in a formula. Higher precedence operators are evaluated first, even if they appear later in the formula. It provides a table that lists C++ operators from highest to lowest precedence.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Appendix A Operator Precedence

It is important to understand that operators have a precedence, but it is not essential to memorize the precedence.

New Term: Precedence is the order in which a program performs the operations in a formula. If one operator has precedence over another operator, it is evaluated first.

Higher precedence operators "bind tighter" than lower precedence operators; thus, higher precedence operators are evaluated first. The lower the rank in the following chart, the higher the precedence.

Table A.1. Operator Precedence.


Rank Name Operator :: 1 scope resolution . -> 2 member selection, subscripting, () function calls, postfix increment ++ -and decrement ++ -3 sizeof, prefix increment and decrement, complement, and, not, unary minus and plus, ^ ! address of and dereference, new, new[], delete, - + &* delete[], casting, sizeof(),
()

4 5 6 7 8 9 10 11 12 13 14 15 16

member selection for pointer multiply, divide, modulo add, subtract shift inequality relational equality, inequality bitwise AND bitwise exclusive OR bitwise OR logical AND logical OR conditional assignment operators

.* ->* */% +<< >> < <= > >= == != & ^ | && || ?: = *= /= %= += -= <<= >>= &= |= ^=

17 18

throw operator comma

throw ,

You might also like