当前位置:网站首页>Why is the default of switch followed by break?
Why is the default of switch followed by break?
2022-07-02 13:23:00 【Weak foundation, earth shaking and mountains shaking】

At first, many people thought it was 5 In fact, the result is 7.
reason : because switch Meet again The matching condition is that it will always be executed downward by default , So in matching default The condition in will be executed downward case 1 and case 2 Conditions in .
As shown in the figure below default After matching, the following two conditions will be executed, resulting in b=4.

And in the case 1: Add break And then it's like this , It's only going to be executed once b++, As shown in the figure below .

And in the defaul Followed by break after b It's not going to happen ++ 了 , As shown in the figure below .

If the foundation is not strong, the earth will shake and the mountains will shake !
边栏推荐
- Tupang multi-target tracking! BOT sort: robust correlated multi pedestrian tracking
- Unity SKFramework框架(十六)、Package Manager 开发工具包管理器
- 能自动更新的万能周报模板,有手就会用!
- Chinese name extraction (toy code - accurate head is too small, right to play)
- Pocket Raider comments
- 二、帧模式 MPLS 操作
- Unity SKFramework框架(十七)、FreeCameraController 上帝视角/自由视角相机控制脚本
- 解答:EasyDSS视频点播时音频是否可以设置为默认开启?
- 2022 zero code / low code development white paper [produced by partner cloud] with download
- [error record] cannot open "XXX" because Apple cannot check whether it contains malware
猜你喜欢

Tencent three sides: in the process of writing files, the process crashes, and will the file data be lost?
![Jerry's watch stops ringing [article]](/img/28/8a225b77b19360d2b0077a2b8c4b6d.jpg)
Jerry's watch stops ringing [article]
![[true topic of the Blue Bridge Cup trials 43] scratch space flight children's programming explanation of the true topic of the Blue Bridge Cup trials](/img/42/21f6d0fdd159faa8b63713624c95a2.png)
[true topic of the Blue Bridge Cup trials 43] scratch space flight children's programming explanation of the true topic of the Blue Bridge Cup trials

Bridge of undirected graph

What are eNB, EPC and PGW?
![[opencv learning] [template matching]](/img/4c/7214329a34974c59b4931c08046ee8.jpg)
[opencv learning] [template matching]

能自动更新的万能周报模板,有手就会用!

Variable, "+" sign, data type

Ali on three sides, it's really difficult to successfully get the offer rated P7
![[opencv] [image gradient]](/img/37/1f366501e2b4e70ecee6365088167c.jpg)
[opencv] [image gradient]
随机推荐
JS逆向之巨量创意signature签名
Download files and preview pictures
难忘阿里,4面技术5面HR附加笔试面,走的真艰难真心酸
TVOC, VOC, VOCs gas detection + Solution
Jerry's weather code table [chapter]
Jerry's weather code table [chapter]
Unity SKFramework框架(十二)、Score 计分模块
[Unity]使用GB2312,打包后程序不正常解决方案
Post order traversal sequence of 24 binary search tree of sword finger offer
Unity SKFramework框架(二十)、VFX Lab 特效库
阿里初面被两道编程题给干掉,再次内推终上岸(已拿电子offer)
What are eNB, EPC and PGW?
Unity skframework framework (XIX), POI points of interest / information points
免费SSL证书知多少?免费SSL证书和收费SSL证书的区别
Operation tutorial: how does easydss convert MP4 on demand files into RTSP video streams?
Jerry's weather direction coding table [chapter]
Clean up system cache and free memory under Linux
JS reverse massive creative signature
[opencv] [image gradient]
Fully autonomous and controllable 3D cloud CAD: crowncad's convenient command search can quickly locate the specific location of the required command.