Hello World
Hello, World!
fn
means function. main function is the beginning of every Rust program.
println!
prints text to the console and its ! indicate that itโs a macro instead of a function.
๐ก Rust files should have .rs file extension and if youโre using more than one word for the file name, follow the snake_case.
Save above code in
file.rs
, but it can be any name with.rs
extension.Compiling via
rustc file.rs
Executing by
./file
on Linux and Mac orfile.exe
on Windows
Rust Playground
Rust Playground is a web interface for running Rust code.
Usages of println!
๐ฏ These are the other usages of println! macro,
Last updated