Chez oim, forum libre

Débattre => Informatique, programmation, geek attitude... => Discussion démarrée par: Songbird le lundi 27 juin 2016, 14:12

Titre: Comment créer un tableau ?
Posté par: Songbird le lundi 27 juin 2016, 14:12
Pour créer un tableau de tout ce qu'il y a de plus primitif, vous devez respecter la syntaxe suivante:
let variable_id : [typeDonnéesTaille; TailleTableau]

Exemple:
Code
let my_awesome_array : [u64; 5] = [1, 2, 3, 4, 5];
println!("{}", my_awesome_array[0]); // => 1

Voir aussi: Comment parcourir un tableau ? (https://chez-oim.org/index.php/topic,1679.0.html)