rust hello world

2024-03-22  本文已影响0人  张中华

安装

地址:
https://www.rust-lang.org/zh-CN/tools/install

检验安装成功命令:
rustc --version

新建一个文件hellowrold.rs

fn main() {
    println!("hello world");
}

执行命令

rustc helloworld.rs
此时会生产两个文件.exe和.pdb,像极了自己在写.net的时候,build之后,也有.pdb和.exe。可能因为在windows下开发的缘故吧,一个可执行文件,和一个调试文件,如此相似。

执行程序,打印出hello wolrd

helloworld.exe

上一篇下一篇

猜你喜欢

热点阅读