Added patch files.

This commit is contained in:
Chris Boesch 2025-07-22 10:08:24 +02:00
parent f21f8f7863
commit ed2f76e960
No known key found for this signature in database
GPG Key ID: 8712DF4D3E364668
2 changed files with 8 additions and 8 deletions

View File

@ -1,9 +1,9 @@
--- exercises/026_hello2.zig 2023-10-03 22:15:22.122241138 +0200
+++ answers/026_hello2.zig 2023-10-05 20:04:06.959431737 +0200
--- exercises/026_hello2.zig 2025-07-22 09:55:51.337832401 +0200
+++ answers/026_hello2.zig 2025-07-22 10:00:11.233348058 +0200
@@ -23,5 +23,5 @@
// to be able to pass it up as a return value of main().
//
// We just learned of a single statement which can accomplish this.
- stdout.print("Hello world!\n", .{});
+ try stdout.print("Hello world!\n", .{});
- stdout.interface.print("Hello world!\n", .{});
+ try stdout.interface.print("Hello world!\n", .{});
}

View File

@ -1,15 +1,15 @@
--- exercises/034_quiz4.zig 2023-10-03 22:15:22.122241138 +0200
+++ answers/034_quiz4.zig 2023-10-05 20:04:06.996099091 +0200
--- exercises/034_quiz4.zig 2025-07-22 09:55:51.337832401 +0200
+++ answers/034_quiz4.zig 2025-07-22 10:05:08.320323184 +0200
@@ -9,10 +9,10 @@
const NumError = error{IllegalNumber};
-pub fn main() void {
+pub fn main() !void {
const stdout = std.io.getStdOut().writer();
var stdout = std.fs.File.stdout().writer(&.{});
- const my_num: u32 = getNumber();
+ const my_num: u32 = try getNumber();
try stdout.print("my_num={}\n", .{my_num});
try stdout.interface.print("my_num={}\n", .{my_num});
}