Skip to content

Latest commit

 

History

History

userinput

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Userinput:

  • main.rs

  • userinput

fn main() {
    /* line string */
    let mut line = String::new();

    /* enter your name */
    println!("Enter your name: ");

    /* store the user input under b1 and pass it to line */
    let b1 = std::io::stdin().read_line(&mut line).unwrap();
    
    /* print the user input */
    println!("Hello: {}", line);
}
$ cargo run