Rust-05 Vec
本文最后更新于:10 个月前
Vec
Vec is a contiguous growable array type.
1 | |
Examples
We can declare a mutable/immutable Vec by Vec::new()
1 | |
We can also declare a vec by vec! macro
1 | |
Macro vec!
1 | |
There are two forms of this macro vec!
- Create a Vec containing a given list of elements:
1 | |
- Create a Vec from a given element and size:
1 | |
Rust-05 Vec
https://trickyrat.github.io/2022/08/07/Rust-05 Vec/