zig/example/hello_world/hello.zig

10 lines
319 B
Zig
Raw Normal View History

const std = @import("std");
2015-11-24 17:43:45 +08:00
2018-02-01 11:48:40 +08:00
pub fn main() !void {
// If this program is run without stdout attached, exit with an error.
var stdout_file = try std.io.getStdOut();
// If this program encounters pipe failure when printing to stdout, exit
// with an error.
try stdout_file.write("Hello, world!\n");
2015-08-06 06:46:40 +08:00
}