The following table lists the precedence and associativity of C++ operators. Operators are listed top to bottom, in descending precedence.

Precedence Operator Description Associativity
1 :: Scope resolution Left-to-right
2 ++  -- Suffix/postfix increment and decrement
type()type{} Function-style type cast
() Function call
[] Array subscripting
. Element selection by reference
-> Element selection through pointer
3 ++  -- Prefix increment and decrement Right-to-left
+  - Unary plus and minus
!  ~ Logical NOT and bitwise NOT
(type) C-style type cast
* Indirection (dereference)
& Address-of
sizeof Size-of
new,new[] Dynamic memory allocation
delete,delete[] Dynamic memory deallocation
4 .*  ->* Pointer to member Left-to-right
5 *  /  % Multiplication, division, and remainder
6 +  - Addition and subtraction
7 <<  >> Bitwise left shift and right shift
8 <  <= For relational operators < and ≤ respectively
>  >= For relational operators > and ≥ respectively
9 ==  != For relational = and ≠ respectively
10 & Bitwise AND
11 ^ Bitwise XOR (exclusive or)
12 | Bitwise OR (inclusive or)
13 && Logical AND
14 || Logical OR
15 ?: Ternary conditional Right-to-left
= Direct assignment (provided by default for C++ classes)
+=  -= Assignment by sum and difference
*=  /=  %= Assignment by product, quotient, and remainder
<<=  >>= Assignment by bitwise left shift and right shift
&=  ^=  |= Assignment by bitwise AND, XOR, and OR
16 throw Throw operator (for exceptions)
17 , Comma Left-to-right

最新文章

  1. linux不同角色server分区方案
  2. win10 office2013激活工具
  3. 纯CSS3实现3D动画导航,html5 webRTC技术实现免费网页电话拨打
  4. C++类的继承实例
  5. 好的 小图标 html
  6. Linux工具之bc计算器进制的转换
  7. gulp提高微信小程序开发效率
  8. Java实现Http请求的常用方式
  9. MSMQ 和 MQTT
  10. SpringCloud笔记四:Ribbon
  11. eclipse-jee-kepler 如何设置编译compiler为1.8
  12. SQL中的ALL,ANY,SOME的用法
  13. PHP 进行支付宝开发中return_url和notify_url的区别分析
  14. OSPF路由协议(一)
  15. [leetcode]Insert Interval @ Python
  16. 【转载】Android 关于arm64-v8a、armeabi-v7a、armeabi、x86下的so文件兼容问题
  17. RequireJS模块化之循环依赖
  18. static, const 和 static const 变量的初始化问题
  19. Markdown入门简介
  20. win7装postgresql10.4

热门文章

  1. JavaScript 、ECMAScript、commonJS 发展历史 与标准化发展
  2. centos 推荐使用epel源
  3. 关于 Oracle外键列上是否需要索引问题?
  4. NanShan即时通讯论——HTML5的优势与劣势
  5. sencha touch笔记(5)——DataView组件(1)
  6. 闲扯 Javascript 02 全选、不选、反选
  7. 关于Linux系统清理/tmp/文件夹的原理
  8. 《高质量程序设计指南:C++/C语言》面试题整理
  9. 130825组队赛-Regionals 2012, North America - East Central NA
  10. Eclipse一个打开文件夹目录插件——Open In Explorer