zig/example/hello_world/hello.zig

10 lines
319 B
Zig
Raw Normal View History

const std = @import("std");
2015-11-24 01:43:45 -08:00
2018-01-31 19: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-05 15:46:40 -07:00
}