O'Reilly logo

C Primer Plus, Fourth Edition by Stephen Prata

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

Section II—C Operators

C is rich in operators. Table RS.I.1 lists the C operators in order of decreasing precedence and indicates how they associate. All operators are binary (two operands) unless otherwise indicated. Note that some binary and unary operators, such as * (multiplication) and * (indirection), share the same symbol but have different precedence. Following the table are summaries of each operator.

Table RS.I.1. The C Operators
Operators (from high to low precedence) Associativity
++ (postfix) (postfix)( ) [ ] . > L–R
++ (prefix) (prefix) - + ~ !

sizeof * (dereference) & (address)

(type) (all unary)
R-L
* / % L–R
+ - (both binary) L–R
<< >> L–R
< > <= >= L–R
== != L–R
& L–R
^ L–R
| L–R
&& L–R
|| L–R
? : (conditional expression) ...

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