diff options
author | Martin Ashby <martin@ashbysoft.com> | 2022-12-10 23:02:40 +0000 |
---|---|---|
committer | Martin Ashby <martin@ashbysoft.com> | 2022-12-10 23:02:40 +0000 |
commit | 5257941f40554da3f8df074443a4c087dcff7004 (patch) | |
tree | b55af272f52f961f8fa02468861de2c255d8a9e2 /exercises/050_no_value.zig | |
parent | 0e447c7956410a993614f9337d6219e017722443 (diff) | |
download | ziglings-5257941f40554da3f8df074443a4c087dcff7004.tar.gz ziglings-5257941f40554da3f8df074443a4c087dcff7004.tar.bz2 ziglings-5257941f40554da3f8df074443a4c087dcff7004.tar.xz ziglings-5257941f40554da3f8df074443a4c087dcff7004.zip |
25-60 completemain
Diffstat (limited to 'exercises/050_no_value.zig')
-rw-r--r-- | exercises/050_no_value.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/exercises/050_no_value.zig b/exercises/050_no_value.zig index 8c73ed3..80d20eb 100644 --- a/exercises/050_no_value.zig +++ b/exercises/050_no_value.zig @@ -65,10 +65,10 @@ const std = @import("std"); const Err = error{Cthulhu}; pub fn main() void { - var first_line1: *const [16]u8 = ???; + var first_line1: *const [16]u8 = undefined; first_line1 = "That is not dead"; - var first_line2: Err!*const [21]u8 = ???; + var first_line2: Err!*const [21]u8 = Err.Cthulhu; first_line2 = "which can eternal lie"; // Note we need the "{!s}" format for the error union string. @@ -77,8 +77,8 @@ pub fn main() void { printSecondLine(); } -fn printSecondLine() ??? { - var second_line2: ?*const [18]u8 = ???; +fn printSecondLine() void { + var second_line2: ?*const [18]u8 = null; second_line2 = "even death may die"; std.debug.print("And with strange aeons {s}.\n", .{second_line2.?}); |