当前位置:网站首页>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
边栏推荐
- [pytorch learning notes] tensor
- AcWing 1127. 香甜的黄油 题解(最短路—spfa)
- 开始练习书法
- Memory management of C
- Data dimensionality reduction principal component analysis
- c语言里怎么设立优先级,细说C语言优先级
- Watchful pioneer world outlook Architecture - (how does a good game come from)
- Registration opportunity of autowiredannotationbeanpostprocessor in XML development mode
- NPOI导出Excel2007
- Juypter notebook modify the default open folder and default browser
猜你喜欢

守望先锋世界观架构 ——(一款好的游戏是怎么来的)

Web2.0 giants have deployed VC, and tiger Dao VC may become a shortcut to Web3

《MongoDB入门教程》第03篇 MongoDB基本概念

搭建哨兵模式reids、redis从节点脱离哨兵集群

xml开发方式下AutowiredAnnotationBeanPostProcessor的注册时机

注解开发方式下AutowiredAnnotationBeanPostProcessor的注册时机

Windows2008R2 安装 PHP7.4.30 必须 LocalSystem 启动应用程序池 不然500错误 FastCGI 进程意外退出

Detailed tutorial on installing stand-alone redis

Istio部署:快速上手微服务,

字典
随机推荐
Golang:[]byte to string
电脑使用哪个录制视频软件比较好
良心总结!Jupyter Notebook 从小白到高手,保姆教程来了!
Data dimensionality reduction principal component analysis
《代码整洁之道》读书笔记
golang:[]byte转string
Golang concurrent programming goroutine, channel, sync
机器学习笔记 - 时间序列预测研究:法国香槟的月销量
PHP asymmetric encryption method private key and public key encryption and decryption method
SQLite 3.39.0 发布,支持右外连接和全外连接
IDEA编辑器去掉sql语句背景颜色SQL语句警告No data sources are configured to run this SQL...和SQL Dialect is Not Config
Pytorch版本、CUDA版本与显卡驱动版本的对应关系
Postman下载安装
安装单机redis详细教程
Web2.0的巨头纷纷布局VC,Tiger DAO VC或成抵达Web3捷径
Codeforces Round #802 (Div. 2) 纯补题
Horizontal ultra vires and vertical ultra vires [easy to understand]
Introduction of Ethernet PHY layer chip lan8720a
[pytorch learning notes] tensor
AcWing 383. 观光 题解(最短路)