zig/example/hello_world/hello_libc.zig

11 lines
266 B
Zig
Raw Normal View History

const c = @cImport({
// See https://github.com/ziglang/zig/issues/515
2017-10-02 09:05:08 +08:00
@cDefine("_NO_CRT_STDIO_INLINE", "1");
@cInclude("stdio.h");
});
export fn main(argc: c_int, argv: [*]?[*]u8) c_int {
2019-05-27 11:35:26 +08:00
_ = c.fprintf(c.stderr, c"Hello, world!\n");
return 0;
}