Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
165 views

C Operators and Precedence

This document describes C operators and their precedence. It lists C operators from highest to lowest precedence and shows whether each associates from the left or right. Functions, arrays, structs, increment/decrement, unary operators and casts have high precedence while assignment operators have low precedence. Comparison operators like == and != are evaluated before logical operators like && and ||.

Uploaded by

soundarpandiyan
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
165 views

C Operators and Precedence

This document describes C operators and their precedence. It lists C operators from highest to lowest precedence and shows whether each associates from the left or right. Functions, arrays, structs, increment/decrement, unary operators and casts have high precedence while assignment operators have low precedence. Comparison operators like == and != are evaluated before logical operators like && and ||.

Uploaded by

soundarpandiyan
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

All C Operators

Description Operator Associates from the Precedence

Function expr () left High


Array expr [] (Evaluated first)
struct indirection ->
struct member .
Incr/decr ++ -- right
One’s complement ~
Unary not !
Address &
Dereference *
Cast ( type )
Unary plus +
Unary minus -
Size in bytes sizeof
Multiplication * left
Division /
Modulus %
Addition +
Subtraction -
Shift Left <<
Shift Right >>
Less than <
Less than or equal <=
Greater than >
Greater than or equal >=
Equal ==
Not equal !=
Bitwise and &
Bitwise exclusive or ^
Bitwise inclusive or |
Logical and &&
Logical or ||
Conditional ?: right
Assignment = %= += *= /=
>>= <<== &=
^= |= (Evaluated last)
Comma , left Low

S. Balaraman

You might also like