Create a Rust vector with Vec::new() or vec![], add items with push(), and access them by index.
Use Vec::new() to create an empty vector or the vec! macro to initialize one with values, then use .push() to add items and indexing to access them.
fn main() {
let mut v: Vec<i32> = Vec::new();
v.push(1);
v.push(2);
let v2 = vec![1, 2, 3];
println!("{}", v2[0]);
}
A vector is a growable list that stores items of the same type in memory. You use it when you need a collection that can change size, like a shopping list or a log of events. Think of it as a dynamic array that automatically expands as you add more items.