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
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
get array element 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
// This is how you access a element of a array, just type the index of the element between the square brackets
let x = my_array[0]
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us