organizado en carpetas

This commit is contained in:
2023-07-04 12:18:40 +02:00
parent d9f4748095
commit 000f8f72a2
76 changed files with 0 additions and 21 deletions

View File

@@ -0,0 +1,21 @@
fn main() {
// definimos un array
let mi_arreglo_3 = ["Lovecraft", "Poe", "Barker", "King"];
// array mutable con 4 enteros
let mut _mi_arreglo_2: [i32; 4] = [2, 4, 8, 16];
// arreglo vacío tipo string
let mut _arreglo_vacio: [&str; 0] = [];
// crea el array con cuatro veces el 123
let arreglo = [123; 4];
// imprimimos para que no den error
println!("{} {} {} ", mi_arreglo_3[1], _mi_arreglo_2[2], arreglo[3]);
let mut mi_arreglo: [&str; 4] = ["", "", "", ""];
mi_arreglo[0] = "Lovecraft";
mi_arreglo[1] = "Poe";
mi_arreglo[2] = "Barker";
mi_arreglo[3] = "King";
println!("{}, {}, {}, {}", mi_arreglo[0], mi_arreglo[1], mi_arreglo[2], mi_arreglo[3]);
}