首页 > 解决方案 > Rust 不打印到终端

问题描述

rustc 在使用println!.

代码:

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

运行它:

me@mclaptop:~
> rustc helloworld.rs

me@mclaptop:~
>

为什么它不打印任何东西?

标签: rust

解决方案


rustc是 Rust 语言的编译器,它只是生成一个可以运行的可执行文件。如果您想实际查看输出,则必须运行该./helloworld命令。

你可以在这里阅读。


推荐阅读