当前位置:网站首页>How to set priorities in C language? Elaborate on C language priorities
How to set priorities in C language? Elaborate on C language priorities
2022-07-02 19:38:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
0. Why should we master priorities
Think about these two questions :
a. Read someone else's code , I can't understand the priority problem , What do I do ?
b. A bunch of parentheses , Is it beautiful ?
I wanted to decorate the wall with a picture , But a pile of paper was used to fix !
Some people say that the code is written too much , Of course . This is a very broad statement . Look at the level of the code you write , Some things you may have been
Can't touch , What about proficiency . Some things must be combed , summary .
1. priority
1.1 Priority chart
The operator with the highest priority is not a real operator , Include : The array subscript , Function call , Structure member selector .
Monocular operators take second place .(! ~ ++ — – (type) * & sizeof)
Then there is binocular operator . In the binocular operator , Arithmetic operator (* / % + -) The highest priority , displacement (<< >>) second , Relationship
Operator (< <= > >= != ==) third , Then there is the bitwise operator (& ^ | ), Logical operators (&& ||) Conditional operator (?: Three orders ),
Assignment operator (= …).
Any logical operator has a lower priority than any relational operator .
The shift operator has a lower priority than the arithmetic operator , But higher than relational operators .
1.2 Operator instance
a. while (c = getc(in) != EOF)
putc(c, out)
Loop means copying one file to another . But because of != The priority of is higher than that of the assignment operator , therefore c
Given to getc() The return value of is the same as EOF Boolean value after comparison , The result is to out A pile of 1.
1.3 Priority doggerel
Vinegar jar sour filling
The taste falls and the blessing beans jump
common 44 Operators
vinegar - Elementary ,4 individual : ( ) [ ] -> Point to structural members . Structural members
The altar - Monocular ,9 individual : ! ~ ++ — - Minus sign ( type ) * The pointer & Address fetch sizeof length
acid - The arithmetic ,5 individual : * / % + - reduce
taste - Displacement ,2 individual : << >>
irrigation - Relationship ,6 individual : < <= > >= == be equal to != It's not equal to
taste - Bit logic ,3 individual : & Bitwise AND ^ Bitwise XOR | Press bit or
fall - Logic ,2 individual : && Logic and || Logic or
jump - Conditions ,1 individual , Three orders : ? :
blessing - assignment ,11 individual : = += -= *= /= %= >>= <<= &= ^= |=
bean - comma ,1 individual : ,
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/148556.html Link to the original text :https://javaforall.cn
边栏推荐
- KS004 基于SSH通讯录系统设计与实现
- 线程应用实例
- LeetCode 0871.最低加油次数 - 类似于POJ2431丛林探险
- AcWing 341. 最优贸易 题解 (最短路、dp)
- Educational Codeforces Round 129 (Rated for Div. 2) 补题题解
- 搭建哨兵模式reids、redis从节点脱离哨兵集群
- 横向越权与纵向越权[通俗易懂]
- 以太网PHY层芯片LAN8720A简介
- Web2.0 giants have deployed VC, and tiger Dao VC may become a shortcut to Web3
- Digital scroll strip animation
猜你喜欢
KS004 基于SSH通讯录系统设计与实现
Data dimensionality reduction principal component analysis
高并发下如何避免产生重复数据?
Set up sentinel mode. Reids and redis leave the sentinel cluster from the node
IDEA编辑器去掉sql语句背景颜色SQL语句警告No data sources are configured to run this SQL...和SQL Dialect is Not Config
守望先锋世界观架构 ——(一款好的游戏是怎么来的)
Chic Lang: completely solve the problem of markdown pictures - no need to upload pictures - no need to network - there is no lack of pictures forwarded to others
450-深信服面经1
定了,就是它!
AcWing 342. Road and route problem solving (shortest path, topological sorting)
随机推荐
SQLite 3.39.0 发布,支持右外连接和全外连接
守望先锋世界观架构 ——(一款好的游戏是怎么来的)
Horizontal ultra vires and vertical ultra vires [easy to understand]
AcWing 1137. 选择最佳线路 题解(最短路)
A4988 drive stepper motor "recommended collection"
A4988驱动步进电机「建议收藏」
metric_ Logger urination
Npoi export Excel2007
R language uses econcharts package to create microeconomic or macroeconomic maps, and indifference function to visualize indifference curve
zabbix5客户端安装和配置
AcWing 1128. 信使 题解(最短路—Floyd)
开始练习书法
Understanding and function of polymorphism
Detailed tutorial on installing stand-alone redis
Bubble sort array
Data dimensionality reduction factor analysis
Which video recording software is better for the computer
SIFT特征点提取「建议收藏」
Binary operation
AcWing 383. 观光 题解(最短路)