mirror of
https://github.com/rust-lang/book.git
synced 2026-05-16 23:10:40 -04:00
608 B
608 B
% Vectors
There is a new edition of the book and this is an old link.
Vectors store more than one value in a single data structure that puts all the values next to each other in memory. Vectors can only store values of the same type.
let v: Vec<i32> = Vec::new();
let numbers = vec![1, 2, 3];
Here are the relevant sections in the new and old books: