DamnSchool
Every operator in 'C' has a precedence associated with it. The precedence is used to determine how an expression involving more than one operator is evaluated. The operator at the higher level of precedence are evaluated first. The operators of the same precedence evaluated either from left to right or right to left depending on the level is known as associativity.


  Operator     Meaning     Associativity     Priority  
( )
[ ]
->
.
Function Call
Square Brackets
Structure Operator
Dot Operator
Left to Right 1
+
-
++
--
!
~
*
&
sizeof
type
Unary Plus
Unary Minus
Increment
Decrement
Not Operator
Complement
Pointer Operator
Address Operator
Size of Operator
Type Cast
Right to Left 2
*
/
%
Multiplication
Division
Modulo division
Left to Right 3
+
-
Addition
Subtraction
Left to Right 4
< <
> >
Left Shift
Right Shift
Left to Right 5
<
< =
>
> =
Less than
Less than or Equal to
Greater than
Greater than or Equal to
Left to Right 6
= =
! =
Equality
Inequality
Left to Right 7
& Bitwise AND Left to Right 8
^ Bitwise exclusive OR Left to Right 9
| Bitwise inclusive OR Left to Right 10
&& Logical AND Left to Right 11
|| Logical OR Left to Right 12
?: Conditional Operator Right to Left 13
=,*=,-=,&=,+=,
^=,!=,<<=,>>=
Assignment Operator Right to Left 14
, Comma Operator Left to Right 15
< Previous Next >



Privacy Policy Terms of Service About
Creative Commons License
This work is licensed under a Creative Commons Attribution-NoDerivatives 4.0 International License.