mirror of
https://github.com/RustyCab/LearnRustEasy.git
synced 2026-02-03 10:13:23 +08:00
Update chapter_3_2.md
This commit is contained in:
@@ -167,7 +167,7 @@ fn main() {
|
||||
fn main() {
|
||||
let a = [1, 2, 3, 4, 5]; //直接写数组的值
|
||||
let b: [i32; 5] = [1, 2, 3, 4, 5]; //显示指定数组的类型和长度
|
||||
let c: [i32; 5] = [3; 5]; //数组每个元素为同样的值,等价于let a = [5, 5, 5, 5, 5];
|
||||
let c: [i32; 5] = [3; 5]; //数组每个元素为同样的值,等价于let a = [3, 3, 3, 3, 3];
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user