A. Operators

Table A.1 lists C++ operators with their precedence, associativity, description, and syntax. The levels—to which I’ve assigned numbers—have no significance beyond the fact that all operators at the same level have equal precedence.


Table A.1: C++ Operators by Precedence Level

Associativity can be left-to-right or right-to-left. This matters when two operators are at the same level of precedence. For example, in the expression

*p++ ...

Get C++ Without Fear: A Beginner’s Guide That Makes You Feel Smart, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.