Rust 不打印到终端

xxj*_*jnn 3 rust

rustc 在使用println!.

代码:

fn main() {
   println!("Hello, world!");
}
Run Code Online (Sandbox Code Playgroud)

运行它:

me@mclaptop:~
> rustc helloworld.rs

me@mclaptop:~
>
Run Code Online (Sandbox Code Playgroud)

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

小智 6

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

你可以在这里阅读它。