| Description | Operator | Associativity |
| Function expression |
( ) |
Left to Right |
| Array Expression |
[] |
Left to Right |
| Structure operators |
-> |
Left to Right |
| Unary minus |
– |
Right to Left |
| Increment & Decrement |
— ++ |
Right to Left |
| One’s compliment |
~ |
Right to Left |
| Pointer Operators |
& * |
Right to Left |
| Type cast |
(data type) |
Right to Left |
| size of operator |
sizeof |
Right to Left |
| Left and Right Shift |
>> << |
|
Arithmetic Operators |
||
| Multiplication operator, Divide by, Modulus |
*, /, % |
Left to Right |
| Add, Substract |
+, – |
Left to Right |
Relational Operators |
||
| Less Than |
< |
Left to Right |
| Greater than |
> |
Left to Right |
| Less than equal to |
<= |
Left to Right |
| Greater than equal to |
>= |
Left to Right |
| Equal to |
== |
Left to Right |
| Not equal |
!= |
Left to Right |
Logical Operators |
||
| AND |
&& |
Left to Right |
| OR |
|| |
Left to Right |
| NOT |
! |
Right to Left |
Bitwise Operators |
||
| AND |
& |
Left to Right |
| Exclusive OR |
^ |
Left to Right |
| Inclusive OR |
| |
Left to Right |
Assignment Operators |
||
|
= |
Right to Left | |
|
*= |
Right to Left | |
|
/= |
Right to Left | |
|
%= |
Right to Left | |
|
+= |
Right to Left | |
|
-= |
Right to Left | |
|
&= |
Right to Left | |
|
^= |
Right to Left | |
|
|= |
Right to Left | |
|
<<= |
Right to Left | |
|
>>= |
Right to Left | |
Other Operators |
||
| Comma |
, |
Right to Left |
| Conditional Operator |
?: |
Right to Left |
Deciphering C Programming Operator Precedence and Associativity: A Comprehensive Guide with Table
About the Author
Coding | Riding | Music,
Embracing the beauty of code, the thrill of the ride, and the rhythm of life. Let's explore the journey together!