From 8810c0d098f6bc5cfead81e88631321867d7505c Mon Sep 17 00:00:00 2001 From: Grumme2 <agh@live.se> Date: Wed, 15 Apr 2020 16:27:47 +0200 Subject: [PATCH] bare3_3 --- examples/bare3.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/bare3.rs b/examples/bare3.rs index b14b810..d60cd1a 100644 --- a/examples/bare3.rs +++ b/examples/bare3.rs @@ -39,7 +39,7 @@ fn main() -> ! { hprintln!("").unwrap(); let a: [u8;4] = [65u8; 4]; - // let mut a = [0u8; 4]; + let mut a = [0u8; 4]; hprintln!("").unwrap(); hprintln!("a = {}", core::str::from_utf8(&a).unwrap()).unwrap(); @@ -102,7 +102,11 @@ fn main() -> ! { // Run the program, what happens and why? // // ** your answer here ** -// +// The output for a is: +// a = +// a is an array of zeros and when its printed it takes the ascii value of 0 +// which is null so it doesnt print anything +// // Commit your answers (bare3_3) // // 4. Alter the program so that the data from `bs` is copied byte -- GitLab