summaryrefslogtreecommitdiffstatshomepage
path: root/exercises/040_pointers2.zig
diff options
context:
space:
mode:
authorChris Boesch <chrboesch@noreply.codeberg.org>2023-04-05 16:11:56 +0200
committerChris Boesch <chrboesch@noreply.codeberg.org>2023-04-05 16:11:56 +0200
commit14ad753001ee86b13e285b431843343815fd35ee (patch)
treeadee3b2436e2885f28e7d2342eedde0e0e9a160c /exercises/040_pointers2.zig
parentb75a76d072f9cc5e0989062a0f45f13ce576d3b6 (diff)
improving the explanation
Diffstat (limited to 'exercises/040_pointers2.zig')
-rw-r--r--exercises/040_pointers2.zig10
1 files changed, 6 insertions, 4 deletions
diff --git a/exercises/040_pointers2.zig b/exercises/040_pointers2.zig
index 43dd2c3..a4852f6 100644
--- a/exercises/040_pointers2.zig
+++ b/exercises/040_pointers2.zig
@@ -12,10 +12,12 @@
// &foo is of type "*u8"
// &bar is of type "*const u8"
//
-// You can always make a constant pointer to a variable, but you cannot
-// make a variable pointer to a constant. This sounds like a logic puzzle,
-// but it just means that once data is declared immutable, you can't
-// coerce it to a mutable type. It's a safety thing (to prevent mistakes).
+// You can always make a const pointer to a mutable value (var), but
+// you cannot make a var pointer to an immutable value (const).
+// This sounds like a logic puzzle, but it just means that once data
+// is declared immutable, you can't coerce it to a mutable type.
+// Think of mutable data as being volatile or even dangerous. Zig
+// always lets you be "more safe" and never "less safe."
//
const std = @import("std");