mirror of
https://github.com/RustyCab/LearnRustEasy.git
synced 2026-02-02 17:59:00 +08:00
Update chapter_3_1.md
This commit is contained in:
@@ -81,5 +81,14 @@ fn main() {
|
||||
let mut b: u32 = 1; // 定义可变变量b
|
||||
b = 2; // 对b的值进行的修改
|
||||
println!("b: {:?}", b); // 输出结果为2
|
||||
|
||||
let c = 5;
|
||||
{
|
||||
// 在当前的花括号作用域内,对之前的c进行隐藏
|
||||
let c = 3;
|
||||
println!("c: {:?}", c); // 输出结果为3
|
||||
}
|
||||
println!("c: {:?}", c); // 输出结果为5
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user