Hello-World
Coding first
- Use an editor that you like. Here I use
Cursorwith rust-analyzer - Create a file named
hello_world.rs, then under the terminal, runrustc hello_world.rs
fn main() {
println("Hello, world!");
}
After the compilation, you will see a binary file hello_world, which is Rust's build file. Just run the file like this ./hello_world
