当前位置:网站首页>Introduction to C language -- summary table of operator priority sorting
Introduction to C language -- summary table of operator priority sorting
2022-07-26 07:12:00 【Code_ tassels】
Preview tips : This article is a summary table of operator priority , It is suitable for introductory learning and middle and late learning , Recommended collection !
√ Quick query :Ctrl + F key , Enter keywords , You can quickly query the operators you want to know .
* reminder : The smaller the priority number , The higher the priority .
priority | Operator | Name or meaning | Use form | Combination direction | explain |
1 | [] | The array subscript | Array name [ Constant expression ] | Left to right | nothing |
() | parentheses | ( expression )/ Function name ( Formal parameter table ) | nothing | ||
. | Member selection ( object ) | object . Member name | nothing | ||
-> | Member selection ( The pointer ) | Object pointer -> Member name | nothing | ||
2 | - | Negative operator | - expression | Right to left | Monocular operator |
~ | Bitwise negation operator | ~ expression | |||
++ | Self - increment operator | ++ Variable name / Variable name ++ | |||
-- | Self - subtracting operator | -- Variable name / Variable name -- | |||
* | Value operators | * Pointer to the variable | |||
& | Fetch address operator | & Variable name | |||
! | Logical nonoperator | ! expression | |||
( type ) | Cast | ( data type ) expression | nothing | ||
sizeof | Length operator | sizeof( expression ) | nothing | ||
3 | / | except | expression / expression | Left to right | Binocular operator |
* | ride | expression * expression | |||
% | remainder ( modulus ) | Integer expression % Integer expression | |||
4 | + | Add | expression + expression | Left to right | Binocular operator |
- | reduce | expression - expression | |||
5 | << | Move left | Variable << expression | Left to right | Binocular operator |
>> | Move right | Variable >> expression | |||
6 | > | Greater than | expression > expression | Left to right | Binocular operator |
>= | Greater than or equal to | expression >= expression | |||
< | Less than | expression < expression | |||
<= | Less than or equal to | expression <= expression | |||
7 | == | be equal to | expression == expression | Left to right | Binocular operator |
!= | It's not equal to | expression != expression | |||
8 | & | Bitwise AND | expression & expression | Left to right | Binocular operator |
9 | ^ | Bitwise XOR | expression ^ expression | Left to right | Binocular operator |
10 | | | Press bit or | expression | expression | Left to right | Binocular operator |
11 | && | Logic and | expression && expression | Left to right | Binocular operator |
12 | || | Logic or | expression || expression | Left to right | Binocular operator |
13 | ?: | Conditional operator | expression 1? expression 2: expression 3 | Right to left | Ternary operator |
14 | = | Assignment operator | Variable = expression | Right to left | |
/= | Assign value after division | Variable /= expression | nothing | ||
*= | Multiply and assign | Variable *= expression | nothing | ||
%= | Assign a value after taking the module | Variable %= expression | nothing | ||
+= | Add and assign | Variable += expression | nothing | ||
-= | Value after subtraction | Variable -= expression | nothing | ||
<<= | Left shift assignment | Variable <<= expression | nothing | ||
>>= | Right shift after assignment | Variable >>= expression | nothing | ||
&= | Bitwise and post assignment | Variable &= expression | nothing | ||
^= | Assign a value after bitwise XOR | Variable ^= expression | nothing | ||
|= | Assign value by bit or after | Variable |= expression | nothing | ||
15 | , | The comma operator | expression , expression ,… | Left to right | nothing |
√ Additional explanation : It should be noted that for Same priority Operator , The operation order is determined by Combination direction Determined by .
2022.7.16 Sort out the records :Code_ tassels (CSDN)
If it helps everyone , I hope you can praise more + Focus on ! In this way, I will be more motivated ! ღ( ´・ᴗ・` ) finger heart .
* attach : For the convenience of preservation , Provide self-made picture version , You can pay attention to the following “ In the words, the flowers bloom and the ink marks ”, reply key word " Operator ", Free access to " Operator priority sorting summary table " HD watermark free original .
边栏推荐
- Agile and tidy way
- Deep learning visualization
- HCIP --- MPLS技术
- Manifest merger failed with multiple errors, see logs
- [QT] how to obtain the number of rows and columns of qtableview and qtablewidget
- RGB-T追踪——【数据集基准】GTOT / RGBT210 / RGBT234 / VOT-2019-2020 / LasHeR / VTUAV
- Drools(2):Drools快速入门
- Drools (4): drools basic syntax (2)
- Check the top 10 best graphics software of the year, meet 99% of your chart needs, and collect it quickly
- Leetcode 1184: distance between bus stops
猜你喜欢

Huffman coding principle

Flame diagram analysis Flink backpressure

Overview of new features of es11, ES12 and es13
![[arm learning (8) AXF tool analysis]](/img/6c/df2ebb3e39d1e47b8dd74cfdddbb06.gif)
[arm learning (8) AXF tool analysis]

404 page best practices to improve user experience

你了解MySQL都包含哪些“零件“吗?

火焰图分析Flink反压

Leetcode 1184: distance between bus stops

Advanced Mathematics (Seventh Edition) Tongji University General exercises two person solution

Common CMD instructions
随机推荐
shape 和 size() 区别
Heap parsing and heap sorting
正则表达式如何写变量
火焰图分析Flink反压
Manifest merger failed with multiple errors, see logs
Kernel pwn 入门 (5)
Overview of new features of es11, ES12 and es13
MySQL table write lock
Opencv learning color detection
Docker modifying the MySQL configuration file attached to the host does not take effect?
如何删除语句审计日志?
Image annotation software reference
【无标题】转载
Benefits of the builder model
Performance test -- lockust performs seckill business scenario test
HCIP --- MPLS技术
Can you learn fast and well with dual stream network? Harbin Institute of Technology & Microsoft proposed a distillation dual encoder model for visual language understanding, which can achieve fast an
Airiot IOT platform enables the container industry to build a welding station information monitoring system
LTS(Light-Task-Scheduler)
Realization of LED water lamp based on C51