Dlang 代码报错: Error: found 'End of File' when expecting ';' following statement
在 Dlang 代码中遇到 "Error: found 'End of File' when expecting ';' following statement" 错误,通常是因为代码末尾缺少分号 ';'。
以下是修正后的代码:
import std.stdio;
import std.string;
import core.stdc.stdio;
void main()
{
mixin(format!('printf("%s", %s);', __traits(getMember, &puts, "mangleof"), "Hello, world!
"));
};
只需在 mixin 语句末尾添加一个分号 ';' 即可解决问题。
原文地址: https://www.cveoy.top/t/topic/n1NQ 著作权归作者所有。请勿转载和采集!