当前位置:网站首页>[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 )
边栏推荐
- NLP pre training technology development
- Minimum commission for stock account opening. Stock account opening is free. Is online account opening safe
- What is the difference between NFT, SFT and dnft? How to build NFT platform applications?
- Gossip about redis source code 78
- [note] glide process and source code analysis
- Interesting 10 CMD commands
- D30:color tunnels (color tunnels, translation)
- Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
- Selenium library 4.5.0 keyword explanation (I)
- 2022 chemical automation control instrument examination content and chemical automation control instrument simulation examination
猜你喜欢
Entropy and full connection layer
It is the most difficult to teach AI to play iron fist frame by frame. Now arcade game lovers have something
Briefly understand the operation mode of developing NFT platform
The first game of the new year, many bug awards submitted
2022 a special equipment related management (elevator) examination questions and a special equipment related management (elevator) examination contents
Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
Collation of the most complete Chinese naturallanguageprocessing data sets, platforms and tools
Yyds dry goods inventory three JS source code interpretation - getobjectbyproperty method
[Mongodb] 2. Use mongodb --------- use compass
Fluent learning (5) GridView
随机推荐
I would like to ask how the top ten securities firms open accounts? Is it safe to open an account online?
Pandaoxi's video
Analysis of refrigeration and air conditioning equipment operation in 2022 and examination question bank of refrigeration and air conditioning equipment operation
[MySQL] classification of multi table queries
Test the influence of influent swacth on the electromagnetic coil of quartz meter
No qualifying bean of type ‘com. netflix. discovery. AbstractDiscoveryClientOptionalArgs<?>‘ available
Similarities and differences of text similarity between Jaccard and cosine
Tencent interview: can you find the number of 1 in binary?
Version rollback revert don't reset better reset must be forced
A treasure open source software, cross platform terminal artifact tabby
D28:maximum sum (maximum sum, translation)
[PHP basics] cookie basics, application case code and attack and defense
2/14 (regular expression, sed streaming editor)
Is the low commission link on the internet safe? How to open an account for China Merchants Securities?
2022 free examination questions for hoisting machinery command and hoisting machinery command theory examination
How to write a good title of 10w+?
ITK learning notes (VII) the position of ITK rotation direction remains unchanged
[note] IPC traditional interprocess communication and binder interprocess communication principle
Development and application of fcitx functional plug-ins
[BSP video tutorial] stm32h7 video tutorial phase 5: MDK topic, system introduction to MDK debugging, AC5, AC6 compilers, RTE development environment and the role of various configuration items (2022-