User Tools

Site Tools


cpp:operators

This is an old revision of the document!


Τελεστές

Η προτεραιότητα των τελεστών στη C++ δίνεται από τον παρακάτω πίνακα.

Level Precedence group Operator Description Grouping
1 Scope :: scope qualifier Left-to-right
2 Postfix (unary) ++ – postfix increment / decrement Left-to-right
() functional forms
[] subscript
. → member access
3 Prefix (unary) ++ – prefix increment / decrement Right-to-left
~ ! bitwise NOT / logical NOT
+ - unary prefix
& * reference / dereference
new delete allocation / deallocation
sizeof parameter pack
(type) C-style type-casting
4 Pointer-to-member .* →* access pointer Left-to-right
5 Arithmetic: scaling * / % multiply, divide, modulo Left-to-right
6 Arithmetic: addition + - addition, subtraction Left-to-right
7 Bitwise shift « » shift left, shift right Left-to-right
8 Relational < > ⇐ >= comparison operators Left-to-right
11 Exclusive or
12 Inclusive or
14 Disjunction
»= «= &= = \= assignment / compound assignment Right-to-left
?: conditional operator
16 Sequencing , comma separator Left-to-right
cpp/operators.1491796008.txt.gz · Last modified: 2017/04/10 02:46 (external edit)