Summary
-
Every Rust program starts at the
main
function -
Inside the
main
function, you can do things like callprintln
-
The
println
macro lets us do interpolation to produce outputs -
We can define variables that hold onto values using
let
-
We can perform basic arithmetic using
+
,-
,*
, and/
-
Each value has a type, which says what kinds of things it can hold
-
A
&str
is the type of a string literal, like"Michael"
-
There are lots of different number types, but we’ll mostly use
i32
-
Get hands-on with 1400+ tech skills courses.