Operators and Punctuators
Operators and Punctuators
Arithmetic, comparison, logical, bitwise, access, cast, and punctuation tokens across C and C++.
Operators and Punctuators
Arithmetic, comparison, logical, bitwise, access, cast, and punctuation tokens across C and C++.
Use reference pages to confirm names, categories, nearby facilities, and the constraints that matter before writing or reviewing code.
+, unary -+, -, *, /, %++, --==, !=, <, <=, >, >=<=>!&&||not, and, or~&, |, ^<<, >>&=, |=, ^=, <<=, >>=bitand, bitor, xor, compl, and_eq, or_eq, xor_eq=+=, -=, *=, /=, %=. member access-> pointer member access[] subscript() function call:: scope resolution in C++.* and ->* pointer-to-member access in C++&*(type)static_cast, dynamic_cast, const_cast, reinterpret_castsizeof, alignof, decltype, typeid, noexcept?:,...;,:{ }( )[ ]< >C++ allows many operators to be overloaded, including:
() and []-> in special proxy designsNot overloadable include:
..*::?:sizeoftypeidint main() {
int total = 0;
for (int i = 0; i < 4; ++i) {
total += i;
}
return total == 6 ? 0 : 1;
}