diff options
author | Dave Gauer <dave@ratfactor.com> | 2021-03-10 20:24:23 -0500 |
---|---|---|
committer | Dave Gauer <dave@ratfactor.com> | 2021-03-10 20:24:23 -0500 |
commit | be36352572ddb18218e1830e49316c259dea5e8c (patch) | |
tree | bfe8d958b7d2c20f64240b5c5546880885d21438 | |
parent | 7d67224043330d22f4199abcc1ab08d82d186ca4 (diff) | |
download | ziglings-be36352572ddb18218e1830e49316c259dea5e8c.tar.gz ziglings-be36352572ddb18218e1830e49316c259dea5e8c.tar.bz2 ziglings-be36352572ddb18218e1830e49316c259dea5e8c.tar.xz ziglings-be36352572ddb18218e1830e49316c259dea5e8c.zip |
Laying down some harsh string facts in ex54.
-rw-r--r-- | exercises/54_manypointers.zig | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/exercises/54_manypointers.zig b/exercises/54_manypointers.zig index 05edd3b..23f2ae5 100644 --- a/exercises/54_manypointers.zig +++ b/exercises/54_manypointers.zig @@ -12,11 +12,13 @@ const std = @import("std"); pub fn main() void { - // Take a good look at the type of the zen12 string: + // Take a good look at the array type to which we're coercing + // the zen12 string (the REAL nature of strings will be + // revealed when we've learned some additional features): const zen12: *const [21]u8 = "Memory is a resource."; - // It would also have been valid to coerce this to a slice: // - // const zen12: []const u8 = "..."; + // It would also have been valid to coerce to a slice: + // const zen12: []const u8 = "..."; // // Now let's turn this into a "many pointer": const zen_manyptr: [*]const u8 = zen12; |