Appendix B. C OPERATORS

I l @ ve RuBoard

Appendix B. C OPERATORS

C is rich in operators. Table B.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  B.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) R-L
= *= /= %= += -= «= >>= &= = ^= R-L
, (comma operator) L-R
I l @ ve RuBoard


C++ Primer Plus
C Primer Plus (5th Edition)
ISBN: 0672326965
EAN: 2147483647
Year: 2000
Pages: 314
Authors: Stephen Prata

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net