Operator Precedence in C

The table below defines operator precedence (and associativity) in C. Hover on any of the operators in the precedence table for further information.

A bullet () represents the operand in unary versions of some operators, for disambiguation.

P.
Arithmetic
,
Bitwise
,
Logical
,
Relational
,
Pointer/Member
and
Other

Operators
As.
1
++
--
.
->
[]
(args)
LTR
2
++
--
+
-
!
~
*
&
(type)
sizeof
RTL
3
*
/
%
Arithmetic LTR
4
+
-
5
<<
>>
Bitwise shift
6
<
<=
>
>=
Relational
7
==
!=
8
&
Bitwise
9
^
10
|
11
&&
Logical
12
||
13
? :
=
*=
/=
%=
+=
-=
<<=
>>=
&=
^=
|=
Conditional and Assignment RTL
14
,
LTR

Note 1: The C++ operator precedence table can be used as well, because the C operators are a subset of the C++ operators.

Note 2: Contrary to many sources, this is indeed the correct precedence and associativity for the ternary operator. See this.

C not your language? Select a different programming language.

Questions, comments ==> info (at) (this domain)

Other quick-reference sites:   db9-pinout.com | resistor-color-codes.com | hex-codes.com

Cheap NFL Jerseys Cheap NFL Jerseys goedkope air max online Basket Air Jordan 11 Christian Louboutin Outlet Cheap Jerseys Wholesale Jerseys Michael Kors Outlet Online Ray Ban Sunglasses Jerseys Wholesale Coach Outlet Store michael jordan air jordan 11 Coach Outlet Cheap NFL Jerseys Kate Spade Outlet Sale air max 90 pas cher junior Wholesale Jerseys Jerseys Cheap nba jerseys vegas Jerseys Wholesale China