打不通你好,世界计划工作
can't get hello, world program to work
我正在尝试让 D (The Programming Language)/d2/Hello, World! 的 hello, world 程序在 codepad.org 上运行。这是我的代码:
/* This program prints a
hello world message
to the console. */
import std.stdio;
void main()
{
writeln("Hello, World!");
}
这是我在 http://codepad.org/MdLVQEMm 运行 时得到的输出:
Line 9: Error: undefined identifier writeln
Line 9: Error: function expected before (), not writeln of type int
关于我做错了什么有什么想法吗?我几乎只是复制/粘贴代码..
来自他们的about page, codepad.org uses D version 1.026, which was released in 2008。作为参考,当前版本是 2.074.1.
现代 D 代码不太可能与如此旧版本的 D 一起工作,尤其是在主要版本升级之后。您必须使用具有更新工具的不同服务。
使用 https://run.dlang.io 由最新编译器支持的在线编辑器。
我正在尝试让 D (The Programming Language)/d2/Hello, World! 的 hello, world 程序在 codepad.org 上运行。这是我的代码:
/* This program prints a
hello world message
to the console. */
import std.stdio;
void main()
{
writeln("Hello, World!");
}
这是我在 http://codepad.org/MdLVQEMm 运行 时得到的输出:
Line 9: Error: undefined identifier writeln
Line 9: Error: function expected before (), not writeln of type int
关于我做错了什么有什么想法吗?我几乎只是复制/粘贴代码..
来自他们的about page, codepad.org uses D version 1.026, which was released in 2008。作为参考,当前版本是 2.074.1.
现代 D 代码不太可能与如此旧版本的 D 一起工作,尤其是在主要版本升级之后。您必须使用具有更新工具的不同服务。
使用 https://run.dlang.io 由最新编译器支持的在线编辑器。