当前位置:网站首页>4. procedure flow structure

4. procedure flow structure

2022-06-21 13:16:00 I want to go sailing

C/C++ Support the most basic three kinds of program running structure : Sequential structure , Selection structure , Loop structure

1. Sequential structure : The program is executed in sequence , No jump
2. Selection structure : According to whether the conditions are met , Selectively perform corresponding functions
3. Loop structure : According to whether the conditions are met , Loop executes a piece of code many times

4.1 Selection structure

4.2 Loop structure

4.3 Jump statements

4.3.1 break sentence

break Timing of use :

1. Appear in the switch In a conditional statement , The effect is to stop case And jump out of switch.
2. Appears in a loop statement , The function is to jump out of the current loop statement .
3. In nested loops , Jump out of the nearest inner loop statement .

4.3.2 continue sentence

In a loop statement , Jump out the remaining unexecuted statements in this loop , Continue with next cycle .

4.3.3 goto sentence

effect : You can jump statements unconditionally .

grammar :goto Mark .

explain : If the name of the tag exists , Execute to goto sentence , Will jump to the mark position .

原网站

版权声明
本文为[I want to go sailing]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/172/202206211206238827.html