September 2004
Beginner
528 pages
10h 26m
English
Table A1 in this section lists C++ operators by precedence, associativity, description, and syntax. The precedence levels—to which I’ve assigned numbers—have no significance beyond the fact that all operators at the same level have equal precedence.
Association can be left to right or right to left. This difference matters when two operators are at the same level of precedence. For example, in the expression
*p++
the * and ++ operators are at the same level of precedence (level 2), so the order of evaluation is determined by associativity—in this case right to left. The expression is therefore evaluated as if written this way:
*(p++)
meaning that it is the pointer p itself (not what it points to) that gets incremented. ...
Read now
Unlock full access