博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
C++运算符优先级 转
阅读量:5330 次
发布时间:2019-06-14

本文共 1362 字,大约阅读时间需要 4 分钟。

Precedence Operator Description Associativity
1 :: Scope resolution Left-to-right
2 ++ -- Suffix/postfix increment and decrement
() 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) 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

转载于:https://www.cnblogs.com/IamHuskar/archive/2012/10/22/2734106.html

你可能感兴趣的文章
[PHP] excel 的导入导出
查看>>
SDL(01-10)
查看>>
IM开发通信协议基础知识(一)---TCP、UDP、HTTP、SOCKET
查看>>
mssql sqlserver 使用sql脚本 清空所有数据库表数据的方法分享
查看>>
分层图最短路【bzoj2763】: [JLOI2011]飞行路线
查看>>
FastReport.Net使用:[18]形状(Shape)控件用法
查看>>
linux下编译复数类型引发的错误:expected unqualified-id before '(' token
查看>>
codeforces 1041A Heist
查看>>
字典常用方法
查看>>
Spring Cloud Stream消费失败后的处理策略(三):使用DLQ队列(RabbitMQ)
查看>>
python的猴子补丁monkey patch
查看>>
架构模式: API网关
查看>>
正则验证积累
查看>>
Linux学习-汇总
查看>>
jQuery瀑布流+无限加载图片
查看>>
83. 删除排序链表中的重复元素
查看>>
bzoj1048 [HAOI2007]分割矩阵
查看>>
python中的__init__ 、__new__、__call__等内置函数的剖析
查看>>
Java中的编码
查看>>
PKUWC2018 5/6
查看>>