当前位置:网站首页>Deep parsing of question mark expressions
Deep parsing of question mark expressions
2022-06-11 03:01:00 【Take you to learn code】
( expression 1)?( expression 2):( expression 3)
If the expression 1 If true, execute the expression 2, Otherwise, execute the expression 3
give an example
int a=5,b=3;
printf("%d",a>b;a:b);function
If a Greater than b If established, execute : The previous is output a. Otherwise execution : The following is output b. In this example, the output is 5
matters needing attention
The question mark expression runs from right to left
for example
int a=8,b=3,c=7;
printf("%d",a>b?a>c?a:c:b>c?b:c);It can be done in three steps
First step :b>c?b:c The result is c
The second step :a>c?a:c The result is a
The third step : The results of the first two steps correspond to the expression 3 And expressions 2 namely a>b?a:c
The final output is zero a namely 8
————————————————
Copyright notice : This paper is about CSDN Blogger 「sxtyhcj」 The original article of , follow CC 4.0 BY-SA Copyright agreement , For reprint, please attach the original source link and this statement .
Link to the original text :https://blog.csdn.net/sxtyhcj/article/details/80324847
边栏推荐
- 基于互联网架构演进, 构建秒杀系统
- Forest v1.5.22 release! Kotlin support
- cmake常用命令
- 巴歇尔槽流量计远程采集物联网关在明渠流量监测的应用
- Unity项目优化详解(持续补充ing)
- What is the difference between a database unique index and a common index?
- AOSP - Developer mode is enabled by default
- 【大咖秀】博睿数据眼中的AIOps,选择正确的赛道正确的人
- Error in Solr access: error initializing queryelevationcomponent
- Rs232/rs485 to 4G DTU uploading temperature and humidity sensor data based on Modbus protocol to remote TCP server
猜你喜欢

完成千万元A轮融资,小象生活能否成为折扣界的“永辉”?

从绿联冲刺IPO,看手机配件市场沉浮录

MySQL学习笔记:JSON嵌套数组查询

WordPress article directory plug-in luckywp table of contents setup tutorial

牛客网:数组中只出现一次的两个数字
![[C language classic]: inverted string](/img/f3/e6f37b852d22d395314628b73c9be3.jpg)
[C language classic]: inverted string

Helm deploy traifik ingress

Live broadcast! Feature matching of orb-slam3 series (mlpnp, word bag model, etc.).

Arduino Uno接JQ8900-16p语音播报模块

Go language advantages and learning Roadmap
随机推荐
DNS Optimization Practice of APP network optimization
Introduction to the functions of today's headline search webmaster platform (portal)
CPT 102_ LEC 20
Win10 安装Office 2016出现错误代码30204-44怎么处理?
WordPress upgrade error: briefly unavailable for scheduled maintenance [resolved]
同一个用户的两次请求SessionId竟然不一致-----记录问题
How can Delma's own brand "take off" when Philips is listed on the market?
GraphAcademy 課程講解:《Neo4j 圖數據科學基礎》
Shell 按行读取文件
Blue Bridge Cup_ Xiao Lan eats candy_ Pigeon nest principle / drawer principle
求MySQL先按大于等于当前时间升序排序,再按小于当前时间降序排序
Navicat premium 15 tool is automatically deleted by anti-virus protection software solution
@Controller @transactional @service annotation is invalid and less dependent
Cypress 88359 WL command enable hotspot
Recent learning and update plan
Why did those who left Beijing, Shanghai and Guangzhou with a smile cry in the end?
判断一串数字是否是快速排序某一次的结果
[big guy show] aiops in the eyes of Borui data, choosing the right track and the right people
How to state clearly and concisely the product requirements?
Can Xiaoxiang life become the "Yonghui" in the discount industry after the completion of the round a financing of tens of millions of yuan?