当前位置:网站首页>[C language] break and continue in switch statement
[C language] break and continue in switch statement
2022-07-03 23:58:00 【YeMing_ LCH】
We're writing switch In the process of statement , Usually each case( or default) The following sentences are marked with “break” ending :
switch (int)
{
case int1:
...;
break;
case int2:
...;
break;
default:
...;
break;
}
If you don't write break What will happen? ?

According to our preset idea , Should carry out case 0: Under the code , The result should be b=2.
The actual operation result is b=1, Explain that after execution b++ After that, the code didn't jump out switch Statement to execute printf, Instead, it went on default Under the b--, Cause the final result to deviate .
And add break There is no problem with the result of running after the statement !

So I'm writing switch Be sure to pay attention to this small detail when you write sentences !!!
So I'm writing switch Be sure to pay attention to this small detail when you write sentences !!!
So I'm writing switch Be sure to pay attention to this small detail when you write sentences !!!
( Important things are to be repeated for 3 times )
边栏推荐
- [2021]NeRF in the Wild: Neural Radiance Fields for Unconstrained Photo Collections
- Report on prospects and future investment recommendations of China's assisted reproductive industry, 2022-2028 Edition
- Selenium library 4.5.0 keyword explanation (II)
- Fudan 961 review
- Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
- Powerful blog summary
- Ramble 72 of redis source code
- "Learning notes" recursive & recursive
- IO flow principle and classification
- 2022 a special equipment related management (elevator) examination questions and a special equipment related management (elevator) examination contents
猜你喜欢
![[source code] VB6 chat robot](/img/89/46b67f627c8257eaddc70a247c9ba5.jpg)
[source code] VB6 chat robot

Pytorch learning notes 5: model creation

China standard gas market prospect investment and development feasibility study report 2022-2028

Collation of the most complete Chinese naturallanguageprocessing data sets, platforms and tools

Private project practice sharing populate joint query in mongoose makes the template unable to render - solve the error message: syntaxerror: unexpected token r in JSON at

How will the complete NFT platform work in 2022? How about its core functions and online time?

Research Report on the scale prediction of China's municipal engineering industry and the prospect of the 14th five year plan 2022-2028

2022 chemical automation control instrument examination content and chemical automation control instrument simulation examination

Enter MySQL in docker container by command under Linux

The first game of the new year, many bug awards submitted
随机推荐
D25:sequence search (sequence search, translation + problem solving)
Pandaoxi's video
NLP Chinese corpus project: large scale Chinese natural language processing corpus
炒股开户佣金优惠怎么才能获得,网上开户安全吗
[leetcode] interview question 17.08 Circus tower
[2021]NeRF in the Wild: Neural Radiance Fields for Unconstrained Photo Collections
Double efficiency. Six easy-to-use pychar plug-ins are recommended
Deep learning ----- using NN, CNN, RNN neural network to realize MNIST data set processing
Distributed transaction -- middleware of TCC -- selection / comparison
2/14 (regular expression, sed streaming editor)
Comment obtenir une commission préférentielle pour l'ouverture d'un compte en bourse? Est - ce que l'ouverture d'un compte en ligne est sécurisée?
The upload experience version of uniapp wechat applet enters the blank page for the first time, and the page data can be seen only after it is refreshed again
D23:multiple of 3 or 5 (multiple of 3 or 5, translation + solution)
Recursive least square adjustment
Schematic diagram of crystal oscillator clock and PCB Design Guide
Fluent learning (5) GridView
P1339 [USACO09OCT]Heat Wave G
Smart fan system based on stm32f407
SPI based on firmware library
[Happy Valentine's day] "I still like you very much, like sin ² a+cos ² A consistent "(white code in the attached table)