diff options
author | Dave Gauer <dave@ratfactor.com> | 2021-02-09 20:15:09 -0500 |
---|---|---|
committer | Dave Gauer <dave@ratfactor.com> | 2021-02-09 20:15:45 -0500 |
commit | 961cf22b88021e9c62d83bd840fe54f205c45f5f (patch) | |
tree | 9503434d0f4e417293527b0e5f3a8dc84ab00bd8 /exercises/43_pointers5.zig | |
parent | 55ad7c32f2d534b1fbd438204d21738f958c51a5 (diff) | |
download | ziglings-961cf22b88021e9c62d83bd840fe54f205c45f5f.tar.gz ziglings-961cf22b88021e9c62d83bd840fe54f205c45f5f.tar.bz2 ziglings-961cf22b88021e9c62d83bd840fe54f205c45f5f.tar.xz ziglings-961cf22b88021e9c62d83bd840fe54f205c45f5f.zip |
Added Quiz 5 for pointers. Elephants!!!
Diffstat (limited to 'exercises/43_pointers5.zig')
-rw-r--r-- | exercises/43_pointers5.zig | 3 |
1 files changed, 1 insertions, 2 deletions
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, }; |