Hellodsd World

Posted 2021-05-01 09:19:42 ‐ 1 min read

Thisqw is the source code of the traditional Hello World program.

test

// This is a comment, and is ignored by the compiler

// This is the main function
fn main() {
    // Statements here are executed when the compiled binary is called

    // Print text to the console
    println!("Hello World!");
}

println! is a macro that prints text to the console.

A binary can be generated using the Rust compiler: rustc.

$ rustc hello.rs

rustc will produce a hello binary that can be executed.

$ ./hello
Hello World!


NNNN
MMMM

编辑:XXX
排版:XXX