Rust 에서 배열 사용

코드 예제

4
0

녹에 배열을 만드는 방법

//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
0
0

배열 요소 녹 가져 오기

//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]

다른 언어로

이 페이지는 다른 언어로되어 있습니다

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................