C++ - Operator Precedence
来源:互联网 发布:chrome 调试 js 编辑:程序博客网 时间:2024/05/17 21:39
The following table lists the precedence and associativity of C++ operators. Operators are listed top to bottom, in descending precedence.
::
Scope resolutionLeft-to-right++
--
Suffix/postfix increment and decrementtype()
type{}
Function-style type cast()
Function call[]
Array subscripting.
Element selection by reference->
Element selection through pointer++
--
Prefix increment and decrementRight-to-left+
-
Unary plus and minus!
~
Logical NOT and bitwise NOT(type)
C-style type cast*
Indirection (dereference)&
Address-ofsizeof
Size-ofnew
,new[]
Dynamic memory allocationdelete
,delete[]
Dynamic memory deallocation.*
->*
Pointer to memberLeft-to-right*
/
%
Multiplication, division, and remainder+
-
Addition and subtraction<<
>>
Bitwise left shift and right shift<
<=
For relational operators < and ≤ respectively>
>=
For relational operators > and ≥ respectively==
!=
For relational = and ≠ respectively&
Bitwise AND^
Bitwise XOR (exclusive or)|
Bitwise OR (inclusive or)&&
Logical AND||
Logical OR?:
Ternary conditionalRight-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 ORthrow
Throw operator (for exceptions),
CommaLeft-to-right 12 2
- C + + operator precedence list
- [C++]C++ Operator Precedence
- C/C++运算符优先级表 - C Operator Precedence Table
- C++ Operator Precedence
- C++ Operator Precedence
- Operator Precedence Hierarchy
- C++ Operator Precedence
- C++ Operator Precedence
- C++ Operator Precedence
- C++ Operator Precedence
- zz C++ Operator Precedence
- C++ Operator Precedence
- C++ Operator Precedence
- rc : C++ Operator Precedence
- C++ - Operator Precedence
- C++ Operator Precedence and associativity
- R:Operator Syntax and Precedence
- Operator Grammar and Operator Precedence Grammar
- web.xml 文件详解
- 有人这样爱你吗?
- Arduino的详细介绍(基于Mega2560)——参考电压analogReference()
- java.lang.IllegalArgumentException: Document base D:\apache-tomcat-6.0.20\webapps\XXX错误
- 苹果开发——设置iTunes Connect中的Contracts, Tax, and Banking
- C++ - Operator Precedence
- unity3d 安装+一个简单的小demo
- CCD与CMOS区别(转载)
- Python中if __name__ == '__main__':作用
- Linux下如何编译、运行C、C++程序?
- leetcode Reverse Linked List II
- Exception in thread "main" java.lang.NoClassDefFoundError: org/objectweb/asm/Type
- was not declared in this scope
- Core Animation之框架简介