This post explains how to compile and run rust
Program
For following below instructions rust
and VsCode
installation is required,
if you don't have rust
installed, follow link
install rust on windows.
CMD
E:\rust-tutorials>mkdir first-project
VsCode
in it.
E:\rust-tutorials>cd first-project
E:\rust-tutorials\first-project>code .
VsCode
create a file main.rs
and write below code and save the file
fn main() {
println!("Hello, rust!");
}
Rust
program , open the terminal and execute below command
E:\rust-tutorials\first-project>rustc main.rs
Rust
program, execute below command
E:\rust-tutorials\first-project>.\main.exe
Successful execution will print "Hello, rust!"
in the terminal
Similar Articles