C++ Operator Precedence
来源:互联网 发布:纽约和西雅图 知乎 编辑:程序博客网 时间:2024/05/21 07:42
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 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
::
Scope resolutionLeft-to-right++
--
Suffix/postfix increment and decrement()
Function call[]
Array subscripting.
Element selection by reference->
Element selection through pointertypeid()
Run-time type information (seetypeid)const_cast
Type cast (see const_cast)dynamic_cast
Type cast (see dynamic_cast)reinterpret_cast
Type cast (see reinterpret_cast)static_cast
Type cast (see static_cast)++
--
Prefix increment and decrementRight-to-left+
-
Unary plus and minus!
~
Logical NOT and bitwise NOT(type)
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 (exceptions throwing),
CommaLeft-to-right
- 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
- 代码注释和格式化的 10 个最佳实践
- 如何为Export2ExcelCommand动态设置导出的文件名
- 测试Android手机内置传感器数量 APILevel 10
- iPhone打包步骤
- poj2352
- C++ Operator Precedence
- C#结构体
- dropDown在beforeOpen事件当中如何获得绑定该DropDown字段field
- andorid GridView与scrollView同时使用出现的问题
- c单链表实现的栈结构
- 偶尔看见迅雷面试题
- 浅析Input 子系统
- java.lang.NoSuchMethodError: jxl.write.WritableSheet.setRowView(ILjxl/CellVi 的处理方法
- 【LCA】Tree