diff options
| author | Chris Boesch <chrboesch@noreply.codeberg.org> | 2026-01-09 22:56:23 +0100 |
|---|---|---|
| committer | Chris Boesch <chrboesch@noreply.codeberg.org> | 2026-01-09 22:56:23 +0100 |
| commit | 1e552a1dd6dac663a9329e5c71c5c7c245f2ed1e (patch) | |
| tree | 6f502293f64d2526234247136ea40a2bb003acfd /exercises/026_hello2.zig | |
| parent | 6972af217899f6c01e86c7e2134126678e4d4a20 (diff) | |
I/O improvements
Diffstat (limited to 'exercises/026_hello2.zig')
| -rw-r--r-- | exercises/026_hello2.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/exercises/026_hello2.zig b/exercises/026_hello2.zig index 9cd8bbc..f110d87 100644 --- a/exercises/026_hello2.zig +++ b/exercises/026_hello2.zig @@ -5,9 +5,6 @@ // const std = @import("std"); -// Instance for input/output operations; we will learn more about this later. -const io = std.Options.debug_io; - // Take note that this main() definition now returns "!void" rather // than just "void". Since there's no specific error type, this means // that Zig will infer the error type. This is appropriate in the case @@ -17,7 +14,10 @@ const io = std.Options.debug_io; // You can find more information at: // https://ziglang.org/documentation/master/#Inferred-Error-Sets // -pub fn main() !void { +pub fn main(init: std.process.Init) !void { + // Instance for input/output operations; we will learn more about this later. + const io = init.io; + // We get a Writer for Standard Out... var stdout_writer = std.Io.File.stdout().writer(io, &.{}); // ...and extract its interface so we can print() to it. |
