rustRust console program example
This is an example of a Rust console program that prints "Hello World!" to the console:
fn main() {
println!("Hello World!");
}
Output example
Hello World!
The code consists of the following parts:
-
fn main()
: This is the main function of the program. It is the entry point of the program and is called when the program is executed. -
println!("Hello World!");
: This line prints the string "Hello World!" to the console.
Helpful links
Related
More of Rust
- How to match whitespace with a regex in Rust?
- How to replace a capture group using Rust regex?
- How to split a string with Rust regex?
- How to iterate over a Rust slice with an index?
- How to use negation in Rust regex?
- How to use regex captures in Rust?
- Regex example to match multiline string in Rust?
- How to get a capture group using Rust regex?
- How to use modifiers in a Rust regex?
- How to create a HashMap of structs in Rust?
See more codes...