当前位置:网站首页>[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 )
边栏推荐
- What are the securities companies with the lowest Commission for stock account opening? Would you recommend it? Is it safe to open an account on your mobile phone
- 2/14 (regular expression, sed streaming editor)
- Live app source code, jump to links outside the station or jump to pages inside the platform
- D23:multiple of 3 or 5 (multiple of 3 or 5, translation + solution)
- Investment demand and income forecast report of China's building ceramics industry, 2022-2028
- "Learning notes" recursive & recursive
- Sword finger offer day 4 (Sword finger offer 03. duplicate numbers in the array, sword finger offer 53 - I. find the number I in the sorted array, and the missing numbers in sword finger offer 53 - ii
- Powerful blog summary
- Tencent interview: can you find the number of 1 in binary?
- A treasure open source software, cross platform terminal artifact tabby
猜你喜欢

Idea integrates Microsoft TFs plug-in

Deep learning ----- using NN, CNN, RNN neural network to realize MNIST data set processing

Yyds dry goods inventory three JS source code interpretation - getobjectbyproperty method

NLP pre training technology development

2022 t elevator repair registration examination and the latest analysis of T elevator repair

leetcode-43. String multiplication

Current detection circuit - including op amp current scheme

"Learning notes" recursive & recursive

ESP Arduino playing with peripherals (V) basic concept of interrupt and timer interrupt
![[Happy Valentine's day]](/img/d9/9280398eb64907a567df6eea772adb.jpg)
[Happy Valentine's day] "I still like you very much, like sin ² a+cos ² A consistent "(white code in the attached table)
随机推荐
2022 Guangdong Provincial Safety Officer a certificate third batch (main person in charge) simulated examination and Guangdong Provincial Safety Officer a certificate third batch (main person in charg
Current detection circuit - including op amp current scheme
D26: the nearest number (translation + solution)
Idea set class header comments
想请教一下,十大劵商如何开户?在线开户是安全么?
Alibaba cloud container service differentiation SLO hybrid technology practice
Collation of the most complete Chinese naturallanguageprocessing data sets, platforms and tools
Cgb2201 preparatory class evening self-study and lecture content
After the Lunar New Year and a half
Advanced C language - pointer 2 - knowledge points sorting
What is the Valentine's Day gift given by the operator to the product?
Analysis on the scale of China's smart health industry and prediction report on the investment trend of the 14th five year plan 2022-2028 Edition
2022.02.13
Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
Selenium check box
2022 t elevator repair registration examination and the latest analysis of T elevator repair
Recursive least square adjustment
Gossip about redis source code 80
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
Iclr2022: how does AI recognize "things I haven't seen"?