运算符优先级-C++运算符优先级
2015-11-30 13:51
141 查看
C++运算符优先级 | |||
优先级 | 运算符 | 描述 | 方向 |
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)-位XOR(异或) | |
12 | | | Bitwise OR (inclusive or)-按位或(包括) | |
13 | && | Logical AND-逻辑和 | |
14 | || | Logical OR-逻辑或 | |
15 | ?: | Ternary conditional-三元运算符 | Right-to-Left |
16 | = | 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-赋值运算符 | ||
17 | throw | Throw operator (for exceptions)-异常操作符 | |
18 | , | Comma | Left-to-right |
相关文章推荐
- 运算符优先级-C语言运算符优先级
- C++11 多线程 一
- simple C++ vector
- 【C语言提高05】静态存储区
- 成员函数指针 C++ FAQ LITE — Frequently Asked Questions
- C++标准库中队列的应用
- C语言 对字符串进行分割
- 常用排序算法C++实现(堆排序,快速排序,归并排序,基数排序)
- 全面介绍Windows内存管理机制及C++内存分配实例
- C++中#if #ifdef的作用
- C++11学习笔记(四)
- C++ 14
- C++ 17
- C++虚函数的总结
- C++的三个基本特征:封装、继承、多态
- C语言编程优化运行速度
- 基于windows平台,dev-c++编译工具,搭建ffmpeg 开发环境
- 编译原理(八) 算符优先分析法(分析过程的算法和C++实现)
- C++ 11
- 汉诺塔算法的递归与非递归的C以及C++源代码