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.

Image
Image
Image

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 live online training, plus books, videos, and digital content from nearly 200 publishers.