要使用dmd2版本中的betterC直接运行代码并查看结果,可以使用以下命令:

dmd -betterC -run your_code.d

其中,-betterC选项告诉dmd将代码编译为betterC,而-run选项执行编译后的代码并输出结果。

例如,如果要运行一个简单的hello world程序:

// hello.d
import std.stdio;

void main()
{
    writeln("Hello, world!");
}

可以使用以下命令来编译并运行代码:

dmd -betterC -run hello.d

输出结果为:

Hello, world!
dlang语言dmd2版本dmd -run命令怎么支持betterC直接运行查看结果

原文地址: http://www.cveoy.top/t/topic/e4Vy 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录