Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUST

how to make an array in rust

//Array declaration. Array sizes must be known at compile time
let my_array: [i32; 5] = [1, 2, 3, 4, 5];

//If the size of the array is not known at compile time. Use a slice or a vector
Source by doc.rust-lang.org #
 
PREVIOUS NEXT
Tagged: #array #rust
ADD COMMENT
Topic
Name
1+8 =