O'Reilly logo

C How to Program, Fifth Edition by H. M. Deitel - Deitel & Associates, Inc., P. J. Deitel - Deitel & Associates, Inc.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix B. Operator Precedence Charts

Operators are shown in decreasing order of precedence from top to bottom (Figs. B.1B.2).

Table B.1. C operator precedence chart.

C Operator

Type

Associativity

()

parentheses (function call operator)

left to right

[]

array subscript

 

.

member selection via object

 

->

member selection via pointer

 

++

unary postincrement

 

--

unary postdecrement

 

++

unary preincrement

right to left

--

unary predecrement

 

+

unary plus

 

-

unary minus

 

!

unary logical negation

 

~

unary bitwise complement

 

( type )

C-style unary cast

 

*

dereference

 

&

address

 

sizeof

determine size in bytes

 

*

multiplication

left to right

/

division

 

%

modulus

 

+

addition

left to right

-

subtraction

 

<<

bitwise left shift

left to right

>>

bitwise right shift

 

<

relational less than

left to right

<=

relational ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required