zz c++操作符优先级表

from:http://www.cppreference.com/wiki//language/operator_precedence?redirect=1

C++ Operator Precedence

The operators at the top of this list are evaluated first. Operators within a group have the same precedence. All operators have left-to-right associativity unless otherwise noted.

PrecedenceOperatorDescriptionOverloadableAssociativity
1::scope resolutionnoleft to right
2()function callyesleft to right
[]array accessyes
->member accessyes
.no
++  --postfixyes
dynamic_cast  static_cast  reinterpret_cast  const_casttype conversionno
typeidGet type informationno
3!  notlogical negationyesright to left
~  complbitwise negation (complement)yes
++  --prefixyes
+  -unary sign operationsyes
*  &indirection and referenceyes
sizeofSize (of the type) of the operand in bytesno
new  new[]  delete  delete[]dynamic memory managementyes
(type)Cast to a given typeyes
4->*member pointer selectoryesleft to right
.*member object selectorno
5*  /  %arithmetic operationsyesleft to right
6+  -
7<<  >>shift operationsyesleft to right
8<  <=  >  >=relational operationsyesleft to right
9==  != not_eq
10&  bitandbitwise ANDyesleft to right
11^  xorbitwise XORyesleft to right
12|  bitorbitwise ORyesleft to right
13&&  andlogical ANDyesleft to right
14||  orlogical ORyesleft to right
15?:Ternary conditional (if-then-else)noright to left
16=  +=  -=  *=  /=  %=  &=  ^= |= <<= >>=assignmentyesright to left
17,Sequential evaluation operatoryesleft to right

转载于:https://www.cnblogs.com/little-rookie/archive/2011/05/07/2039663.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值