Operator(s) Description Associativity
:: Scope resolution (C++ only) N/A
++ --
()
[]
.
->
Postfix increment and decrement
Function call
Array subscript
Element selection by reference
Element selection by pointer
Left-to-Right
++ -- Prefix increment and decrement Right-to-Left
= Assignment Right-to-Left
*= Multiplication Assignment Right Left
/= Division assignment Right-to-Left
+ - Unary plus and minus Right-to-Left
! Logical NOT N/A
(type) Type cast Right-to-Left
* Indirection (dereference) N/A
& Address-of (reference) N/A
sizeof() Size-of-type N/A
sizeof Size of object N/A
delete Dynamic memory (de-)allocation (C++ only) N/A
.* ->* Pointer to member (C++ only) Left-to-Right
 % modulus (remainder) Left-to-Right
* / Multiplication, division, and Left-to-Right
<< >> Bitwise left shift and right shift Left-to-Right
+ - Addition and subtraction Left-to-Right
< <=
> >=
Relational “less than” and “less than or equal to”
Relational “greater than” and “greater than or equal to”
Left-to-Right
== Relational “equal to” Left-to-Right
 != and “not equal to” Left-to-Right
&= Bitwise AND assignment Left-to-Right
^ Bitwise XOR (exclusive or) Left-to-Right
| Bitwise OR (inclusive or) Left-to-Right
&& Logical AND Left-to-Right
|| Logical OR Left-to-Right
 
c?t:f Ternary conditional (see ?:) Right-to-Left
=
+= -=
*= /= %=
<<= >>=
&= ^= |=
Direct assignment
Assignment by sum and difference
Assignment by product, dividend, and remainder
Assignment by bitwise shift
Assignment by bitwise AND, XOR, and OR
, Comma Left-to-Right
 

[edit] Arithmetic operators

Operator Name Syntax Overloadable Included in C
Unary Plus +a Yes Yes
Addition (Sum) a + b Yes Yes
Prefix Increment ++a Yes Yes
Postfix Increment a++ Yes Yes
Assignment by Addition a += b Yes Yes
Unary Minus (Negation) -a Yes Yes
Subtraction (Difference) a - b Yes Yes
Prefix Decrement --a Yes Yes
Postfix Decrement a-- Yes Yes
Assignment by Subtraction a -= b Yes Yes
Multiplication (Product) a * b Yes Yes
Assignment by Multiplication a *= b Yes Yes
Division (Dividend) a / b Yes Yes
Assignment by Division a /= b Yes Yes
Modulus (Remainder) a % b Yes Yes
Assignment by Modulus a %= b Yes Yes

[edit] Comparison operators

Operator Name Syntax Overloadable Included in C
Less Than a < b Yes Yes
Less Than or Equal To a <= b Yes Yes
Greater Than a > b Yes Yes
Greater Than or Equal To a >= b Yes Yes
Not Equal To a != b Yes Yes
Equal To a == b Yes Yes
Logical Negation !a Yes Yes
Logical AND a && b Yes Yes
Logical OR a || b Yes Yes

[edit] Bitwise operators

Operator Name Syntax Overloadable Included in C
Bitwise Left Shift a << b Yes Yes
Assignment by Bitwise Left Shift a <<= b Yes Yes
Bitwise Right Shift a >> b Yes Yes
Assignment by Bitwise Right Shift a >>= b Yes Yes
Bitwise One's Complement ~a Yes Yes
Bitwise AND a & b Yes Yes
Assignment by Bitwise AND a &= b Yes Yes
Bitwise OR a | b Yes Yes
Assignment by Bitwise OR a |= b Yes Yes
Bitwise XOR a ^ b Yes Yes
Assignment by Bitwise XOR a ^= b Yes Yes

[edit] Other operators

Operator Name Syntax Overloadable Included in C
Basic Assignment a = b Yes Yes
Function Call a() Yes Yes
Array Subscript a[b] Yes Yes
Indirection (Dereference) *a Yes Yes
Address-of (Reference) &a Yes Yes
Member by Pointer a->b Yes Yes
Member a.b No Yes
Member by Pointer Indirection a->*b Yes No
Member Indirection a.*b No No
Cast (type) a Yes Yes
Comma a , b Yes Yes
Ternary Conditional a ? b : c No Yes
Scope Resolution a::b No No
Size-of sizeof a No Yes
Size-of sizeof (type) No Yes
Type Identification typeid type No No
Allocate Storage new type Yes No
Deallocate Storage delete a Yes No
       
       
       
       
       

[edit] Language extensions

Operator Name Syntax Overloadable Vendor
Label Value && label  ? GCC