第05章_语句

简单语句

语句作用域

  • 可以在 if, switch, while, 和 for 语句的控制结构内定义变量

条件语句

if 语句

switch 语句

迭代语句

while 语句

传统的 for 语句

范围 for 语句

do while 语句

跳转语句

break 语句

continue 语句

goto 语句

try 语句块和异常处理

throw 表达式

1
throw runtime_error("ERROR");

try 语句块

1
2
3
4
5
6
7
try {
...
} catch (exception declaration) {
...
} catch (exception declaration) {
...
}

标准异常