Created
March 20, 2019 03:10
-
-
Save rust-play/5ed21a9365453ca72db2fc08fee21222 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() { | |
let mut array: [String; 7] = Default::default(); | |
attempt(&mut array); | |
println!("{:?}", array); | |
} | |
fn attempt(array: &mut [String]){ | |
let a = "amit".to_string(); | |
array[0] = a; | |
array[1] = "mom".to_string(); | |
array[2] = "dad".to_string(); | |
array[3] = "grandma".to_string(); | |
array[4] = "grandad".to_string(); | |
array[5] = "grandam1".to_string(); | |
array[6] = "grandad2".to_string(); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment