diff --git a/zig-code/samples/hello-world.zig b/zig-code/samples/hello-world.zig index 657939f23..cb988c45f 100644 --- a/zig-code/samples/hello-world.zig +++ b/zig-code/samples/hello-world.zig @@ -1,7 +1,13 @@ const std = @import("std"); pub fn main() !void { - try std.fs.File.stdout().writeAll("hello world!\n"); + var stdout_buffer: [1024]u8 = undefined; + var stdout_writer = std.fs.File.stdout().writer(&stdout_buffer); + const stdout = &stdout_writer.interface; + + try stdout.print("hello world!\n", .{}); + + try stdout.flush(); } // exe=succeed