You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Learn more about: C++ built-in operators, precedence, and associativity
C++ built-in operators, precedence, and associativity
07/23/2020
operators (C++), hierarchy
operator precedence
precedence, operators
operators (C++), associativity
multiple operators [C++]
associativity of operators [C++]
operators [C++], precedence
evaluation order
hierarchy, operator
95c1f0ba-dad8-4034-b039-f79a904f112f
C++ built-in operators, precedence, and associativity
The C++ language includes all C operators and adds several new operators. Operators specify an evaluation to be performed on one or more operands.
Precedence and associativity
Operator precedence specifies the order of operations in expressions that contain more than one operator. Operator associativity specifies whether, in an expression that contains multiple operators with the same precedence, an operand is grouped with the one on its left or the one on its right.
Alternative spellings
C++ specifies alternative spellings for some operators. In C, the alternative spellings are provided as macros in the <iso646.h> header. In C++, these alternatives are keywords, and use of <iso646.h> or the C++ equivalent <ciso646> is deprecated. In Microsoft C++, the /permissive- or /Za compiler option is required to enable the alternative spellings.
C++ operator precedence and associativity table
The following table shows the precedence and associativity of C++ operators (from highest to lowest precedence). Operators with the same precedence number have equal precedence unless another relationship is explicitly forced by parentheses.