mirror of
https://github.com/google/comprehensive-rust.git
synced 2024-12-16 23:08:36 +02:00
19 lines
448 B
Markdown
19 lines
448 B
Markdown
|
# Hello World!
|
||
|
|
||
|
Let us jump into the simplest possible Rust program, a classic Hello World
|
||
|
program:
|
||
|
|
||
|
```rust
|
||
|
fn main() {
|
||
|
println!("Hello 🌍!");
|
||
|
}
|
||
|
```
|
||
|
|
||
|
What you see:
|
||
|
|
||
|
* Functions are introduced with `fn`.
|
||
|
* Blocks are delimited by curly braces like in C and C++.
|
||
|
* The `main` function is the entry point of the program.
|
||
|
* Rust has hygenic macros, `println!` is an example of this.
|
||
|
* Rust strings can contain Unicode characters, such as emoji.
|