rustRust Hello World example
This is a simple example of a "Hello World" program written in Rust.
fn main() {
println!("Hello, world!");
}
Output example
Hello, world!
The code consists of two parts:
-
The
fn main()
function: This is the entry point of the program. All Rust programs must have amain
function. -
The
println!
macro: This macro prints a string to the console. The!
indicates that it is a macro, not a function.
Helpful links
Related
More of Rust
- How to get a capture group using Rust regex?
- How to find the first match in a Rust regex?
- How to use regex to match a group in Rust?
- How to use regex to match a double quote in Rust?
- How to parse JSON string in Rust?
- How to match the end of a line in a Rust regex?
- How to use regex with bytes in Rust?
- How to calculate the inverse of a matrix in Rust?
- How to replace a capture group using Rust regex?
- How to replace all matches using Rust regex?
See more codes...