aboutsummaryrefslogtreecommitdiff
path: root/exercises/038_structs2.zig
diff options
context:
space:
mode:
authorDave Gauer <dave@ratfactor.com>2021-04-04 16:38:40 -0400
committerDave Gauer <dave@ratfactor.com>2021-04-04 16:38:40 -0400
commit20e5bb2b1933e3b2430a12f46f7b542e8f606617 (patch)
tree22d90a9229e04ae498420e9427ca26ca0db01708 /exercises/038_structs2.zig
parentbed01210e0fc2b3d84741c3a4731be73e1cec786 (diff)
downloadziglings-20e5bb2b1933e3b2430a12f46f7b542e8f606617.tar.gz
ziglings-20e5bb2b1933e3b2430a12f46f7b542e8f606617.tar.bz2
ziglings-20e5bb2b1933e3b2430a12f46f7b542e8f606617.tar.xz
ziglings-20e5bb2b1933e3b2430a12f46f7b542e8f606617.zip
Explaining undefined 0xAA in 038 (for issue #43)
Diffstat (limited to 'exercises/038_structs2.zig')
-rw-r--r--exercises/038_structs2.zig8
1 files changed, 7 insertions, 1 deletions
diff --git a/exercises/038_structs2.zig b/exercises/038_structs2.zig
index b0db022..4f2ce48 100644
--- a/exercises/038_structs2.zig
+++ b/exercises/038_structs2.zig
@@ -4,7 +4,7 @@
// them to functions, etc.
//
// This exercise demonstrates how we can store structs in an array and
-// how doing so lets us print them all (both) using a loop.
+// how doing so lets us print them using a loop.
//
const std = @import("std");
@@ -50,3 +50,9 @@ pub fn main() void {
});
}
}
+
+// If you tried running the program without adding Zump as mentioned
+// above, you get what appear to be "garbage" values. In debug mode
+// (which is the default), Zig writes the repeating pattern "10101010"
+// in binary (or 0xAA in hex) to all undefined locations to make them
+// easier to spot when debugging.