Associativity and precedence of operators
Operators
|
Associativity
|
() [] -> \.
|
left to right
|
! ~ ++ -- + - * & (type) sizeof
|
right to left
|
* / %
|
left to right
|
+ -
|
left to right
|
<< >>
|
left to right
|
< <= > >=
|
left to right
|
== !=
|
left to right
|
&
|
left to right
|
^
|
left to right
|
|
|
left to right
|
&&
|
left to right
|
||
|
left to right
|
?:
|
right to left
|
= += -= *= /= %= &= ^= |= <<= >>=
|
right to left
|
,
|
left to right
|
Unary +, -, and *
have higher precedence than their binary versions.
Prefix ++ and --
have higher precedence than their postfix versions.
Next topic:
Constant expressions
Previous topic:
Structure operators
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004