Skip to content

Instantly share code, notes, and snippets.

@panicbit
Last active June 22, 2016 13:14
Show Gist options
  • Save panicbit/47db886a6c347857136f5cbe6f4c7ef9 to your computer and use it in GitHub Desktop.
Save panicbit/47db886a6c347857136f5cbe6f4c7ef9 to your computer and use it in GitHub Desktop.
use std::io::stdin;
fn main() {
let mut line = String::new();
loop {
let n_read = stdin().read_line(&mut line).unwrap();
println!("n_read: {}", n_read);
if n_read == 0 {
break;
}
println!("read line: \"{}\"", line);
line.clear();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment