windows 7 下Rust 入门 Helloworld 怎么编写

2024-10-13 03:47:24

1、首先要在 电脑上安装 rust 语言,具体可参考

2、打开一个编辑器,我用的是 Notepad ++ ,其他也可以,建议初学 最好用 文本编辑器,不要用什么IDE

3、输入代码:// This is a comment, and will 水瑞侮瑜be ignored by t茑霁酌绡he compiler// 本行为注释,会被编译器忽略// This is the main function// 这是主函数fn main() { println!("Hello World!");}

windows 7 下Rust 入门 Helloworld 怎么编写

5、打开一个 COMMAND, 转到 文件保存目录,输入 rustc hello.rs,回车。

windows 7 下Rust 入门 Helloworld 怎么编写

7、验证结果 ,在COMMAN锓旆痖颧D 中 直接 输入 hello.exe如果 显示 hello world,表示编写成功

windows 7 下Rust 入门 Helloworld 怎么编写

8、rust 编程还是比较简单容易上手的。

猜你喜欢