aboutsummaryrefslogtreecommitdiff
path: root/exercises/044_quiz5.zig
diff options
context:
space:
mode:
Diffstat (limited to 'exercises/044_quiz5.zig')
-rw-r--r--exercises/044_quiz5.zig2
1 files changed, 2 insertions, 0 deletions
diff --git a/exercises/044_quiz5.zig b/exercises/044_quiz5.zig
index 8a0d88c..3e6ee79 100644
--- a/exercises/044_quiz5.zig
+++ b/exercises/044_quiz5.zig
@@ -19,12 +19,14 @@ const Elephant = struct {
pub fn main() void {
var elephantA = Elephant{ .letter = 'A' };
// (Please add Elephant B here!)
+ var elephantB = Elephant{ .letter = 'B' };
var elephantC = Elephant{ .letter = 'C' };
// Link the elephants so that each tail "points" to the next elephant.
// They make a circle: A->B->C->A...
elephantA.tail = &elephantB;
// (Please link Elephant B's tail to Elephant C here!)
+ elephantB.tail = &elephantC;
elephantC.tail = &elephantA;
visitElephants(&elephantA);