044_quiz5.patch 667 B

1234567891011121314151617
  1. --- exercises/044_quiz5.zig 2023-10-03 22:15:22.122241138 +0200
  2. +++ answers/044_quiz5.zig 2023-10-05 20:04:07.039433235 +0200
  3. @@ -19,12 +19,14 @@
  4. pub fn main() void {
  5. var elephantA = Elephant{ .letter = 'A' };
  6. // (Please add Elephant B here!)
  7. + var elephantB = Elephant{ .letter = 'B' };
  8. var elephantC = Elephant{ .letter = 'C' };
  9. // Link the elephants so that each tail "points" to the next elephant.
  10. // They make a circle: A->B->C->A...
  11. elephantA.tail = &elephantB;
  12. // (Please link Elephant B's tail to Elephant C here!)
  13. + elephantB.tail = &elephantC;
  14. elephantC.tail = &elephantA;
  15. visitElephants(&elephantA);