cargo --verison
cargo new hello_cargo --bin
cd hello_cargo
fn main() {
println!("Hello, world!");
}
println!
은 러스트 매크로이다.println
은 함수이다.[package]
name = "hello_cargo"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
# 컴파일
cargo build
# 실행
./target/debug/hello_cargo
# 또는
# 컴파일 및 실행
cargo run
# 컴파일 체크:
cargo check