Question : how to read from stdin rust
Answered by : jimmy-hypi
use std::io;
let mut input = String::new();
match io::stdin().read_line(&mut input) { Ok(n) => { println!("{} bytes read", n); println!("{}", input); } Err(error) => println!("error: {}", error),
}Run
Source : https://doc.rust-lang.org/std/io/struct.Stdin.html#method.read_line | Last Update : Fri, 28 Feb 20