From 961cf22b88021e9c62d83bd840fe54f205c45f5f Mon Sep 17 00:00:00 2001 From: Dave Gauer Date: Tue, 9 Feb 2021 20:15:09 -0500 Subject: Added Quiz 5 for pointers. Elephants!!! --- exercises/43_pointers5.zig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'exercises/43_pointers5.zig') diff --git a/exercises/43_pointers5.zig b/exercises/43_pointers5.zig index adfaea1..dc178ec 100644 --- a/exercises/43_pointers5.zig +++ b/exercises/43_pointers5.zig @@ -44,7 +44,7 @@ const Class = enum{ const Character = struct{ class: Class, gold: u32, - health: u8, + health: u8 = 100, // <--- You can also fields a default value! experience: u32, }; @@ -52,7 +52,6 @@ pub fn main() void { var glorp = Character{ .class = Class.wizard, .gold = 10, - .health = 100, .experience = 20, }; -- cgit v1.2.3-ZIG