2012年12月14日 星期五

Precedence and associativity of Operators in C

運算子的優先性和結合性


Precedence and associativity 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

沒有留言:

張貼留言