diff --git a/examples/bare3.rs b/examples/bare3.rs index 3d2a21d3b03e6916d28916fc16a7b368015441c7..584e3e04d6a0c8349cf3747fee79627ff7968e09 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) //