0% found this document useful (0 votes)
111 views

C Operator Precedence Table

Operator precedence in C is determined by the order in which operators are applied in an expression. This document lists C operators from highest to lowest precedence along with their associativity, which indicates the order of evaluation for operators of equal precedence. It provides details on operators such as parentheses, arithmetic operators, relational operators, logical operators, and assignment operators.

Uploaded by

Pavan Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
111 views

C Operator Precedence Table

Operator precedence in C is determined by the order in which operators are applied in an expression. This document lists C operators from highest to lowest precedence along with their associativity, which indicates the order of evaluation for operators of equal precedence. It provides details on operators such as parentheses, arithmetic operators, relational operators, logical operators, and assignment operators.

Uploaded by

Pavan Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

difranco.

net

COperatorPrecedenceTable
ThispagelistsCoperatorsinorderofprecedence(highesttolowest).Theirassociativityindicatesinwhatorderoperatorsof
equalprecedenceinanexpressionareapplied.
Operator

Description

Associativity

()
[]
.
>
++

Parentheses(functioncall)(seeNote1)
Brackets(arraysubscript)
Memberselectionviaobjectname
Memberselectionviapointer
Postfixincrement/decrement(seeNote2)

lefttoright

++
+
!~
(type)
*
&
sizeof

Prefixincrement/decrement
Unaryplus/minus
Logicalnegation/bitwisecomplement
Cast(convertvaluetotemporaryvalueoftype)
Dereference
Address(ofoperand)
Determinesizeinbytesonthisimplementation

righttoleft

*/%

Multiplication/division/modulus

lefttoright

Addition/subtraction

lefttoright

Bitwiseshiftleft,Bitwiseshiftright

lefttoright

<<=
>>=

Relationallessthan/lessthanorequalto
Relationalgreaterthan/greaterthanorequalto

lefttoright

==!=

+
<<>>

Relationalisequalto/isnotequalto

lefttoright

&

BitwiseAND

lefttoright

BitwiseexclusiveOR

lefttoright

BitwiseinclusiveOR

lefttoright

&&

LogicalAND

lefttoright

||

LogicalOR

lefttoright

?:

Ternaryconditional

righttoleft

Assignment
Addition/subtractionassignment
Multiplication/divisionassignment
Modulus/bitwiseANDassignment
Bitwiseexclusive/inclusiveORassignment
Bitwiseshiftleft/rightassignment

righttoleft

Comma(separateexpressions)

lefttoright

=
+==
*=/=
%=&=
^=|=
<<=>>=
,

You might also like