Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUST

rust get input on the same line as question

use std::io::{self, Write};

fn main() {
    let mut input = String::new();
    print!("Enter a string >> ");
    let _ = io::stdout().flush();
    io::stdin().read_line(&mut input).expect("Error reading from STDIN");
}
//use flush
 
PREVIOUS NEXT
Tagged: #rust #input #line #question
ADD COMMENT
Topic
Name
5+3 =