Precedence and Associativity of Operators

From <The C Programming Language>(p.53)
 

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 the binary forms.
 

posted @ 2011-05-18 22:21  walfud  阅读(907)  评论(3编辑  收藏  举报