Skip to content
Snippets Groups Projects
Commit db7c7110 authored by Ridge's avatar Ridge
Browse files

bare3_3

parent ba4e9199
No related branches found
No related tags found
No related merge requests found
Pipeline #137 canceled
...@@ -40,7 +40,7 @@ fn main() -> ! { ...@@ -40,7 +40,7 @@ fn main() -> ! {
hprintln!("").unwrap(); hprintln!("").unwrap();
a = [65u8; 4]; a = [65u8; 4];
//let mut a = [0u8; 4]; let mut a = [0u8; 4];
hprintln!("").unwrap(); hprintln!("").unwrap();
hprintln!("a = {}", core::str::from_utf8(&a).unwrap()).unwrap(); hprintln!("a = {}", core::str::from_utf8(&a).unwrap()).unwrap();
...@@ -95,10 +95,23 @@ fn main() -> ! { ...@@ -95,10 +95,23 @@ fn main() -> ! {
// Commit your answers (bare3_2) // Commit your answers (bare3_2)
// //
// 3. Uncomment line `let mut a = [0u8; 4]; // 3. Uncomment line `let mut a = [0u8; 4];
//` //
// Run the program, what happens and why? // 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) // Commit your answers (bare3_3)
// //
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment