aboutsummaryrefslogtreecommitdiff
path: root/exercises/042_pointers4.zig
diff options
context:
space:
mode:
Diffstat (limited to 'exercises/042_pointers4.zig')
-rw-r--r--exercises/042_pointers4.zig11
1 files changed, 10 insertions, 1 deletions
diff --git a/exercises/042_pointers4.zig b/exercises/042_pointers4.zig
index 261dbc1..359a2f1 100644
--- a/exercises/042_pointers4.zig
+++ b/exercises/042_pointers4.zig
@@ -1,6 +1,15 @@
//
// Now let's use pointers to do something we haven't been
-// able to do before: pass a value by reference to a function!
+// able to do before: pass a value by reference to a function.
+//
+// Why would we wish to pass a pointer to an integer variable
+// rather than the integer value itself? Because then we are
+// allowed to *change* the value of the variable!
+//
+// +-----------------------------------------------+
+// | Pass by reference when you want to change the |
+// | pointed-to value. Otherwise, pass the value. |
+// +-----------------------------------------------+
//
const std = @import("std");