C++ provides a fairly limited number of statements. Most of these affect the flow of control within a program:
while, for, and do while statements, which implement iterative loops
while、for 以及 do while 语句,实现反复循环;
if and switch, which provide conditional execution
if 和 switch,提供条件分支结构;
continue, which stops the current iteration of a loop
continue,终止当次循环;
break, which exits a loop or switch statement
break,退出一个循环或 switch 语句;
goto, which transfers control to a labeled statement
goto,将控制跳转到某个标号语句;
try, catch, which define a try block enclosing a sequence of statements that might throw an exception. The catch clause(s) are intended to handle the exception(s) that the enclosed code might throw.
try、catch 语句,实现 try 块的定义,该语句包含一个可能抛出异常的语句序列,catch 子句则用来处理在 try 块里抛出的异常;
throw expressions, which exit a block of code, transferring control to an associated catch clause
throw 表达式,用于退出代码块的执行,将控制转移给相关的 catch 子句。
In addition, there are expression statements and declaration statements. An expression statement causes the subject expression to be evaluated. Declarations and definitions of variables were described in Chapter 2.