当前位置:网站首页>[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 )
边栏推荐
- D27:mode of sequence (maximum, translation)
- Gossip about redis source code 75
- 股票开户最低佣金炒股开户免费,网上开户安全吗
- What is the Valentine's Day gift given by the operator to the product?
- How to prevent malicious crawling of information by one-to-one live broadcast source server
- Docking Alipay process [pay in person, QR code Payment]
- Powerful blog summary
- 2/14 (regular expression, sed streaming editor)
- Gossip about redis source code 79
- Correlation analysis summary
猜你喜欢

Axure resources and prototype tool Axure RP 9 download

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

The difference between single power amplifier and dual power amplifier
![[note] IPC traditional interprocess communication and binder interprocess communication principle](/img/f6/36c28df02198539e27352e3cdf4ba6.jpg)
[note] IPC traditional interprocess communication and binder interprocess communication principle

Is user authentication really simple

Fluent learning (4) listview

2/14 (regular expression, sed streaming editor)

Schematic diagram of crystal oscillator clock and PCB Design Guide
![[Mongodb] 2. Use mongodb --------- use compass](/img/d5/0eb7dd4c407fbf2e9ba1b175f5424d.jpg)
[Mongodb] 2. Use mongodb --------- use compass

SPI based on firmware library
随机推荐
How to make icons easily
2022 a special equipment related management (elevator) examination questions and a special equipment related management (elevator) examination contents
Investment demand and income forecast report of China's building ceramics industry, 2022-2028
Gossip about redis source code 81
How to make recv have a little temper?
Idea integrates Microsoft TFs plug-in
SPI based on firmware library
After the Lunar New Year and a half
Ramble 72 of redis source code
Test the influence of influent swacth on the electromagnetic coil of quartz meter
leetcode-43. String multiplication
2020.2.14
Cgb2201 preparatory class evening self-study and lecture content
D28:maximum sum (maximum sum, translation)
Recursive least square adjustment
Gossip about redis source code 73
Selenium library 4.5.0 keyword explanation (I)
Vscode regular match replace console log(.*)
Alibaba cloud container service differentiation SLO hybrid technology practice
[note] glide process and source code analysis