C Language and Libraries Help (clang.hlp) (
Table of Contents;
Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
Operator Precedence
◄Up► ◄Contents► ◄Index► ◄Back►
─────C/C++ Language─────────────────────────────────────────────────────────
The table below lists the C/C++ operators and their precedence and
associativity values. The lines separate precedence levels. The
highest precedence level is at the top of the table.
Symbol Name or Meaning Associativity
───────────────────────────────Highest Precedence─────────────────────────
:: Scope resolution None
──────────────────────────────────────────────────────────────────────────
++ Post-increment Left to right
-- Post-decrement
( ) Function call
[ ] Array element
-> Pointer to structure member
. Structure or union member
──────────────────────────────────────────────────────────────────────────
++ Pre-increment Right to left
-- Pre-decrement
:> Base
! Logical NOT
~ Bitwise NOT
- Unary minus
+ Unary plus
& Address
* Indirection
sizeof Size in bytes
new Allocate program memory
delete Deallocate program memory
(type) Type cast [for example, (float) i]
──────────────────────────────────────────────────────────────────────────
.* Pointer to member (objects) Left to right
->* Pointer to member (pointers)
──────────────────────────────────────────────────────────────────────────
* Multiply Left to right
/ Divide
% Remainder
──────────────────────────────────────────────────────────────────────────
+ Add Left to right
- Subtract
──────────────────────────────────────────────────────────────────────────
<< Left shift Left to right
>> Right shift
──────────────────────────────────────────────────────────────────────────
< Less than Left to right
<= Less than or equal to
> Greater than
>= Greater than or equal to
──────────────────────────────────────────────────────────────────────────
== Equal Left to right
!= Not equal
──────────────────────────────────────────────────────────────────────────
& Bitwise AND Left to right
──────────────────────────────────────────────────────────────────────────
^ Bitwise exclusive OR Left to right
──────────────────────────────────────────────────────────────────────────
| Bitwise OR Left to right
──────────────────────────────────────────────────────────────────────────
&& Logical AND Left to right
──────────────────────────────────────────────────────────────────────────
|| Logical OR Left to right
──────────────────────────────────────────────────────────────────────────
? : Conditional Right to left
──────────────────────────────────────────────────────────────────────────
= Assignment Right to left
*=, /=, Compound assignment
%=, +=,
-=, <<=,
>>=,
&=, ^=,
|=
──────────────────────────────────────────────────────────────────────────
, Comma Left to right
────────────────────────────────Lowest Precedence─────────────────────────
See: ◄Operators by Category►
-♦-