Reading User Input in Rust
Learn how to read and display user input in Rust using standard input/output.
Learn how to read and display user input in Rust using standard input/output.
use std::io;
fn main() {
let mut input = String::new();
println!("Enter something:");
io::stdin().read_line(&mut input).expect("Failed to read line");
println!("You entered: {}", input);
}