当前位置:网站首页>4. 程序流程结构
4. 程序流程结构
2022-06-21 12:06:00 【我想要去航海】
C/C++支持最基本的三种程序运行结构:顺序结构,选择结构,循环结构
1. 顺序结构:程序按照顺序执行,不发生跳转
2. 选择结构:根据条件是否满足,有选择的执行相应功能
3. 循环结构:依据条件是否满足,循环多次执行某段代码
4.1 选择结构
4.2 循环结构
4.3 跳转语句
4.3.1 break语句
break使用的时机:
1. 出现在switch条件语句中,作用是终止case并跳出switch。
2. 出现在循环语句中,作用是跳出当前的循环语句。
3. 出现在嵌套循环中,跳出最近的内层循环语句。
4.3.2 continue语句
在循环语句中,跳出本次循环中余下尚未执行的语句,继续执行下一次循环。
4.3.3 goto语句
作用:可以无条件跳转语句。
语法:goto 标记。
解释:如果标记的名称存在,执行到goto语句,会跳转到标记的位置。
边栏推荐
- Is pension insurance a financial product? What is the expected return?
- Architect training plan - infinite thinking - variables
- WPF uses Maui's self drawing logic
- 方法的继承和重写
- Rectangular coverage area
- 【无标题】
- i. MX - rt1052 pulse width modulation (PWM)
- Inheritance and override of methods
- Understand Flink operatorchain object reuse
- [comprehensive pen test] sword finger offer II 114 Alien dictionary
猜你喜欢

Standing at the digital tuyere, how can tooling enterprises "fly"

Hands on data analysis data reconstruction

HMS core machine learning service ID card identification function to achieve efficient information entry

i.MX - RT1052 SDCard操作(SDIO接口)

Creation mode - singleton mode

i. MX - rt1052 input / output (GPIO)

Brief discussion on four full bonding processes of oca\uv-oca loca\sloca

动手学数据分析 数据重构

Typera free version, without cracking, can be installed and used directly

站在数字化风口,工装企业如何“飞起来”
随机推荐
HMS Core机器学习服务身份证识别功能,实现信息高效录入
『忘了再学』Shell流程控制 — 36、for循环介绍
Redis-bitmap 位图
【综合笔试题】难度 2.5/5 :「树状数组」与「双树状数组优化」
Centos7 upgrade MySQL 5.6.40 to enterprise 5.6.49
MySQL-DML
PCB电路板设计都有哪些注意事项?
Corrigendum to 138 sets of reference solutions to the real problems of Higher Algebra in 2022
LeetCode-高度检查器
STM32笔记之 PWM(脉宽调制)
Nanjing University static program analyses -- Introduction learning notes
Understand Flink operatorchain object reuse
The difference between knowing and understanding
STM32開發之 VS Code + gcc環境編譯
20N10-ASEMI中低压MOS管20N10
The final battle of the giant: instant retailing
搭建zabbix监控及邮件报警
2-zabbix使用自动发现自动添加主机
2. 引用
嵌入struct和嵌入interface