Skip to content

Commit

Permalink
revert step 8
Browse files Browse the repository at this point in the history
  • Loading branch information
Ksitta authored Sep 24, 2024
1 parent a93ba16 commit 52186a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/step8/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
**8.4** for 循环的 init、ctrl 和 post 都可以被省略。省略 ctrl 等价于将其替换为一个非零常数,比如 1。

**8.5** 循环语句有其自己的作用域,且是它所在的作用域的子集。循环体也有其作用域,且是循环语句的作用域的子集。如果 for 循环的 init 是一条声明,则其所声明的变量所属的作用域是整个 for 循环语句的作用域(包含 init、ctrl、post 和循环体)。
> 例如,`for (int i=0;;i=i+1) { int i=1; return i; }` 是不合法的代码片段
> 例如,`for (int i=0;;i=i+1) { int i=1; return i; }` 是合法的代码片段
**8.7** continue 语句和 break 语句要么出现在循环体里,要么其就是循环体。

Expand Down

0 comments on commit 52186a6

Please sign in to comment.