It's a convention to start learning a new programming language by writing a program that prints "Hello, World!"
to the console.
In Rust, we can do this using the println!
macro. The !
indicates that this is a macro rather than a function.
A macro is a way to write code that writes other code. Macros are a powerful feature of Rust that allow you to write code that writes code. This is useful for metaprogramming, which is the process of writing code that writes code.
The println!
macro is used to print text to the console. It is similar to the println
function in other programming languages, but it is a macro in Rust.
Here's how to print Hello
to the console using the println!
macro:
Write a program that prints "Hello, World!"
to the console using the println!
macro.
alemack17
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!");}
uptickmetachu
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!")}
abhishekvaid
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("{}", "Hello, world!")}
sobornostea
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!")}
lvntcnylmz
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!");}
Asamsodien
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!")}
Wolfy7
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!");}
ppavlovdev
pub fn hello_world() { println!("Hello, world!"); // Use the println! macro to print "Hello, world!" to the console}
jcvielm
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!");}
jcvielm
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!");}
wirew0lf
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!");}
danjambur
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!");}
ruuderie
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!");}
aga7hokakological
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!");}
msmps
pub fn hello_world() { println!("Hello, world!");}
ames89
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!");}
mdelvaux
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!")}
M4ti5
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!"); }
nrmnqdds
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!");}
jualexandre
pub fn hello_world() { println!("Hello, world!")}
bushuai
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!");}
anandprabhu
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!");}
UzairRehman4
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!");}
kylelau519
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!");}
dHuberYoumans
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!");}
toddlers
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!")}
tylp
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!");}
ejdraper
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!");}
vremyavnikuda
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!")}
Auy-Natthadit
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!");}
Zewamen
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!");}
Venu171
pub fn hello_world() { println!("Hello, world!");}
markdamics
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!")}
shantaram10
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!")}
jeroen-rooijmans
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!");}
manizzle
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!")}
Takkaryx
pub fn hello_world() { println!("Hello, world!"); // Use the println! macro to print "Hello, world!" to the console}
impossibleDoctor
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!");}
MOmarMiraj
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!")}
n3h
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!");}
chf0x
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!");}
esdrastarsis
pub fn hello_world() { println!("Hello, world!");}
jvoss
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!");}
EphraimBsB
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!");}
fennr
pub fn hello_world() { // Use the println! macro to print "Hello, world!" to the console println!("Hello, world!")}