diff options
| author | Luka Markušić <markusicluka@gmail.com> | 2026-05-31 22:26:17 +0200 |
|---|---|---|
| committer | Luka Markušić <markusicluka@gmail.com> | 2026-06-01 22:32:11 +0200 |
| commit | e61bedaa25e4bc80847c4fb1508b5f4cdf35cd20 (patch) | |
| tree | 89ce6d46b9d58a0373f2b44220f3df808fa1cf2e /patches | |
| parent | ac9f96459ce1ce2c1cec5605cf6075d0fbf559b7 (diff) | |
Add another defer exercise
Diffstat (limited to 'patches')
| -rw-r--r-- | patches/patches/116_defer3.patch | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/patches/patches/116_defer3.patch b/patches/patches/116_defer3.patch new file mode 100644 index 0000000..7b2cce5 --- /dev/null +++ b/patches/patches/116_defer3.patch @@ -0,0 +1,14 @@ +--- exercises/116_defer3.zig 2026-05-31 22:29:56.189323732 +0200 ++++ answers/116_defer3.zig 2026-05-31 22:30:17.749186667 +0200 +@@ -7,9 +7,9 @@ + var x: u32 = 100; + { + // Try reordering the statements to get the answer 42 +- defer x = x / 10; +- defer x = x + 11; + defer x = x * 2; ++ defer x = x + 11; ++ defer x = x / 10; + + // It might seem silly in this example, but it's important to know when + // deinitializing containers whose elements need to be deinitialized first. |
