C++ Operators

The following list contains C++ operators organized by category.

Additive

Addition: +

Subtraction: –

 

Assignment

Addition Assignment: +=

Assignment: =

Bitwise AND Assignment: &=

Bitwise exclusive OR Assignment: ^=

Bitwise inclusive OR Assignment: |=

Division Assignment: /=

Left shift assignment: <<=

Modulus Assignment: %=

Multiplication Assignment: *=

Right shift assignment: >>=

Subtraction Assignment: –=

 

Bitwise

Bitwise AND: &

Bitwise exclusive OR: ^

Bitwise inclusive OR: |

Logical

Logical AND: &&

Logical OR: ||

 

Miscellaneous

Comma: ,

Conditional: ? :

Pointer-to-member: .* or –>*

Reference: &

Scope resolution: ::

 

Multiplicative

Division: /

Modulus: %

Multiplication: *

Postfix

Cast: ()

Function call: ( )

Member access: . and –>

Postfix decrement: ––

Postfix increment: ++

Subscript: [ ]

Relational and Equality

Equality: ==

Greater than or equal to: >=

Greater than: >

Less than or equal to: <=

Less than: <

Not equal: !=

Shift

Left shift: <<

Right shift: >>

 

Unary

Address-of: &

delete

Indirection: *

Logical Negation: !

new

One's Complement: ~

Prefix decrement: ––

Prefix increment: ++

sizeof

Unary Plus Operator: +

Unary Negation Operator: -

 

See Also

Reference

Operator Precedence and Associativity

Operator Overloading

C++ Keywords

Lexical Conventions