Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUST

initializing array rust

let _: [u8; 3] = [1, 2, 3];
let _: [&str; 3] = ["1", "2", "3"];

let _: [String; 3] = [
    String::from("1"),
    String::from("2"),
    String::from("3")
];

let mut rng = rand::thread_rng();
let _: [u8; 3] = [rng.gen(), rng.gen(), rng.gen()];
Source by www.joshmcguigan.com #
 
PREVIOUS NEXT
Tagged: #initializing #array #rust
ADD COMMENT
Topic
Name
3+1 =