forked from 0x-r4bbit/intro-to-rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
https://github.com/prophen/intro-to-rust/blob/nikema's-notes/exercises/04.md
- Memory safety is the guarantee that Rust gives us
- ownership means values get passed and when the value is no longer needed it is dropped
- borrowing is passing by reference
String -> &String -> &str
Value Reference String Slice?
use std::io;
fn main() {
println!("Hi, what's your name? ");
let mut name = String::new();
io::stdin().read_line(&mut name).unwrap();
println!("Hello {}", name);
}
Metadata
Metadata
Assignees
Labels
No labels