summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Boesch <chrboesch@noreply.codeberg.org>2025-12-28 02:01:19 +0100
committerChris Boesch <chrboesch@noreply.codeberg.org>2025-12-28 02:01:19 +0100
commit8e30debc6aa05a9313a085ba52b38d5c7224a7ea (patch)
tree800d4422f0c1baf0ece3e7aa953df6352f3f27a7
parentb33fd5a7448619ce37ff1fd78d0a4fba7661b6ff (diff)
improved i/o explanation for exc. 26
-rw-r--r--exercises/026_hello2.zig5
1 files changed, 3 insertions, 2 deletions
diff --git a/exercises/026_hello2.zig b/exercises/026_hello2.zig
index 081c2b3..7daa9e2 100644
--- a/exercises/026_hello2.zig
+++ b/exercises/026_hello2.zig
@@ -5,7 +5,7 @@
//
const std = @import("std");
-// Instance for input/output, we'll learn how to create them later.
+// Instance for input/output operations, we'll learn how to create them later.
const io = std.Options.debug_io;
// Take note that this main() definition now returns "!void" rather
@@ -18,8 +18,9 @@ const io = std.Options.debug_io;
// https://ziglang.org/documentation/master/#Inferred-Error-Sets
//
pub fn main() !void {
- // We get a Writer interface for Standard Out so we can print() to it.
+ // 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.
const stdout = &stdout_writer.interface;
// Unlike std.debug.print(), the Standard Out writer can fail