跟我一起学rust-hello_world

后端 / 笔记 / 2021-11-04

创建目录

mkdir hello_world
cd hello_world

新建文件

文件名:main.rs

fn main(){
    println!("Hello,World!");
}

编译

rustc main.rs

运行

./main
Hello,Wrold!

总结

  • rust源文件是以*.rs结尾的.
  • println 用来打印输出
  • rustc 是rust编译命令