Day 2

A Basic Input/Output Program in Rust

Try it!



View the source code


use std::io;

fn main() {
 println!("This is my first program in rust.");
 println!("Type something random");
 let mut input = String::new();
 io::stdin().read_line(&mut input);
 println!("You typed: {}", input.trim());
}

Description


This is my first Rust program. Despite it being basic it helped me to understand I/O in Rust better. This reminded me of C++ and how the functions and I/O works.

Previous Day
Next Day