diff options
author | Toby Vincent <tobyv@tobyvin.dev> | 2024-07-02 13:55:55 -0500 |
---|---|---|
committer | Toby Vincent <tobyv@tobyvin.dev> | 2024-08-06 14:31:34 -0500 |
commit | 76b3a6de32ebe5f411a8fa4e69cf2d1fee96a04d (patch) | |
tree | 03796901bd2d3d809be143684bdbac0b2d46bee1 /exercises/006_strings.zig | |
parent | 99c9c42ff2b9749e3036b922dd4952bc989be68c (diff) |
Diffstat (limited to 'exercises/006_strings.zig')
-rw-r--r-- | exercises/006_strings.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/exercises/006_strings.zig b/exercises/006_strings.zig index 5a7172c..3ad26ce 100644 --- a/exercises/006_strings.zig +++ b/exercises/006_strings.zig @@ -24,18 +24,18 @@ pub fn main() void { // (Problem 1) // Use array square bracket syntax to get the letter 'd' from // the string "stardust" above. - const d: u8 = ziggy[???]; + const d: u8 = ziggy[4]; // (Problem 2) // Use the array repeat '**' operator to make "ha ha ha ". - const laugh = "ha " ???; + const laugh = "ha " ** 3; // (Problem 3) // Use the array concatenation '++' operator to make "Major Tom". // (You'll need to add a space as well!) const major = "Major"; const tom = "Tom"; - const major_tom = major ??? tom; + const major_tom = major ++ " " ++ tom; // That's all the problems. Let's see our results: std.debug.print("d={u} {s}{s}\n", .{ d, laugh, major_tom }); |