Vectors
Growable arrays.
What Is a Vector?
A Vec<T> is a growable array. Unlike a fixed-size array, a vector can grow or shrink at runtime.
All elements must be the same type T.
fn main() {
let v: Vec<i32> = Vec::new();
println!("empty vector with length {}", v.len());
}Creating with vec!
The vec! macro is the easiest way to create a vector with initial values.
fn main() {
let numbers = vec![1, 2, 3, 4];
println!("{:?}", numbers);
}