⇤ ← 于2006-06-18 20:08:14修订的的版本1
837
备注:
|
902
|
删除的内容标记成这样。 | 加入的内容标记成这样。 |
行号 1: | 行号 1: |
## page was renamed from Control Flow/3.1 Statements and Blocks |
3.1 Statements and Blocks
An expression such as x = 0 or i++ or printf(...) becomes a statement when it is followed by a semicolon, as in
x = 0; i++; printf(...);
In C, the semicolon is a statement terminator, rather than a separator as it is in languages like Pascal.
Braces { and } are used to group declarations and statements together into a compound statement, or block, so that they are syntactically equivalent to a single statement. The braces that surround the statements of a function are one obvious example; braces around multiple statements after an if, else, while, or for are another. (Variables can be declared inside any block; we will talk about this in Chapter 4.) There is no semicolon after the right brace that ends a block.