From db7c7110b4872d5c72759bc953bcfb9b8d255c60 Mon Sep 17 00:00:00 2001 From: Ridgep <ridpet-5@student.ltu.se> Date: Thu, 7 Mar 2019 17:05:07 +0100 Subject: [PATCH] bare3_3 --- examples/bare3.rs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/examples/bare3.rs b/examples/bare3.rs index 3d2a21d..584e3e0 100644 --- a/examples/bare3.rs +++ b/examples/bare3.rs @@ -40,7 +40,7 @@ fn main() -> ! { hprintln!("").unwrap(); a = [65u8; 4]; - //let mut a = [0u8; 4]; + let mut a = [0u8; 4]; hprintln!("").unwrap(); hprintln!("a = {}", core::str::from_utf8(&a).unwrap()).unwrap(); @@ -95,10 +95,23 @@ fn main() -> ! { // Commit your answers (bare3_2) // // 3. Uncomment line `let mut a = [0u8; 4]; -//` +// // Run the program, what happens and why? // -// ** your answer here ** +// bare3 +// s = ABCD +// bs = [65, 66, 67, 68] +// iterate over slice +// 65,66,67,68,iterate iterate using (raw) indexing +// 65, +// 66, +// 67, +// 68, +// +// +// a = +// +// Since 0 in ASCII is nothing, then the value of our a array will be empty. // // Commit your answers (bare3_3) // -- GitLab