The Scope of a Variable 变数的范围
The scope of a variable is the region of your program in which it is defined.
一个变量的作用域是程序中定义这个变量的区域。
Even if the scope of a variable is limited to a block, its lifetime is still that of the entire procedure.
即使变量的范围被限制在某个块内,其生存期仍为整个过程的生存期。
The narrower the scope of a variable, the fewer opportunities you have for accidentally referring to it in place of another variable with the same name.
变量的范围越窄,引用另一个同名变量时不小心引用到该变量的机会就越少。
应用推荐