当前位置:网站首页>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 .
边栏推荐
- Shared lock
- 优炫数据库JDBC打开日志方式有哪些
- Manifest merger failed with multiple errors, see logs
- Wechat applet - from entry to penetration
- MySQL intent lock
- With Huawei cloud welink, you can connect to the world even in the countryside
- XSS labs (1-10) break through details
- Kernel pwn 入门 (5)
- 火焰图分析Flink反压
- 问题:Can‘t download sh shellcheck. Please install it manually及shell脚本的一些命令使用
猜你喜欢
随机推荐
RGB-T追踪——【数据集基准】GTOT / RGBT210 / RGBT234 / VOT-2019-2020 / LasHeR / VTUAV
Image annotation software reference
Business secret series -- Talking about the evaluation of commercial passwords from the perspective of Party A and Party B (I)
Kernel pwn 入门 (5)
10 papers of ant security laboratory were included by ccf-a top meeting to explore the realization of AI credibility from the perspective of algorithm
【一库】妙啊!这个库组织npm脚本简直爆炸!
[database] CTE (common table expression)
How to use Hyper-V in win10 Home Edition
Leetcode question brushing 1: topic classification
SQL shell (PSQL) tool under PostgreSQL
HCIP --- MPLS技术
What are the basics of getting started with spot silver
123123123
I don't understand the MySQL 57 version under centos7 when I encounter a problem. I was informed by big Shen who knows it
[749. Isolate virus]
Benefits of the builder model
Opencv learn read images videos and webcams
Docker modifying the MySQL configuration file attached to the host does not take effect?
Acwing- daily question
Advanced Mathematics (Seventh Edition) Tongji University exercises 2-5 personal solutions








