当前位置:网站首页>[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 )
边栏推荐
- Iclr2022: how does AI recognize "things I haven't seen"?
- The interviewer's biggest lie to deceive you, bypassing three years of less struggle
- I would like to ask how the top ten securities firms open accounts? Is it safe to open an account online?
- D27:mode of sequence (maximum, translation)
- SQL data update
- 1214 print diamond
- Docking Alipay process [pay in person, QR code Payment]
- [Mongodb] 2. Use mongodb --------- use compass
- 【leetcode】300. Longest increasing subsequence (dynamic programming, dichotomy)
- D24:divisor and multiple (divisor and multiple, translation + solution)
猜你喜欢

NLP pre training technology development

2022.02.13

Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?

Idea set class header comments

Regular expressions and text processors for shell programming

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

STM32 GPIO CSDN creative punch in
![[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)

Kubedl hostnetwork: accelerating the efficiency of distributed training communication

Test the influence of influent swacth on the electromagnetic coil of quartz meter
随机推荐
"Learning notes" recursive & recursive
Gossip about redis source code 73
China standard gas market prospect investment and development feasibility study report 2022-2028
2022 system integration project management engineer examination knowledge points: software development model
NLP Chinese corpus project: large scale Chinese natural language processing corpus
2022 t elevator repair registration examination and the latest analysis of T elevator repair
AI Challenger 2018 text mining competition related solutions and code summary
Analysis of refrigeration and air conditioning equipment operation in 2022 and examination question bank of refrigeration and air conditioning equipment operation
2022 free examination questions for hoisting machinery command and hoisting machinery command theory examination
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
Unity elementary case notes of angry birds Siki college 1-6
How to understand the gain bandwidth product operational amplifier gain
Schematic diagram of crystal oscillator clock and PCB Design Guide
D29:post Office (post office, translation)
【leetcode】374. Guess the size of the number
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 interviewer's biggest lie to deceive you, bypassing three years of less struggle
股票開戶傭金最低的券商有哪些大家推薦一下,手機上開戶安全嗎
Report on prospects and future investment recommendations of China's assisted reproductive industry, 2022-2028 Edition
It is forbidden to splice SQL in code