O'Reilly logo

SAMS Teach Yourself C++ in 10 Minutes SECOND EDITION by Jesse Liberty

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix B. Operator Precedence

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

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. Table B.1 lists the C++ operators by precedence.

Table B.1. Operator Precedence
Rank Name Operator
1 Scope resolution ::
2 Member selection, subscripting, function calls, postfix increment and decrement . ->

()

++ --
3 Prefix increment and decrement, complement, and, not, unary minus and plus, address of and dereference, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required