Chinaunix首页 | 论坛 | 博客
  • 博客访问: 9117
  • 博文数量: 9
  • 博客积分: 190
  • 博客等级: 入伍新兵
  • 技术积分: 115
  • 用 户 组: 普通用户
  • 注册时间: 2010-09-22 15:02
文章分类

全部博文(9)

文章存档

2014年(1)

2011年(4)

2010年(4)

我的朋友
最近访客

分类: C/C++

2011-03-05 22:45:21

C++ 运算符优先级:

::   scope resolution     lr


()   funtion call         lr

[]   array acess 

->   member access

.    member access

++  --    postfix

dynamic_cast  static_cast reinterpret_cast const_pret    type conversion

typeid      get type information


!      logical negation                      rl

~      bitwise logical negation

++ --   prefix

+   -   

*  &    reference

sizeof

new new[]  delete   delete[]

(type)


->*

.*


*  /  %  

+   -


<<   >>


<   <=   >  >=


==   !=



^


|


&&


||


?:


= += -=  *=  %=  /=  &=  |=  ^=  <<=  >>=


,


除去第三优先级( ! ~  ++  --(prefix) + -  dynamic_cast static_cast reinterpret_cast   const_cast  type_id) 以及赋值运算符和条件运算符外,全部为自左向右赋值的顺序。


阅读(616) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2011-03-27 18:34:11

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com