diff options
| author | Ibrahim Muftee <ibrahim@muftee.net> | 2026-06-29 15:11:40 -0500 |
|---|---|---|
| committer | Ibrahim Muftee <ibrahim@muftee.net> | 2026-06-29 15:15:14 -0500 |
| commit | bdfe3df2947f8787c8a4ef8c534f6a8932e13871 (patch) | |
| tree | f2df9a5f56b6c7f95c0978a861cb0ecf60560391 /exercises/006_strings.zig | |
| parent | d093f37e1e4c5aed4a4c8d4999001134aec251ca (diff) | |
feat: begin solving exercises
Diffstat (limited to 'exercises/006_strings.zig')
| -rw-r--r-- | exercises/006_strings.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/exercises/006_strings.zig b/exercises/006_strings.zig index 08977de..4238874 100644 --- a/exercises/006_strings.zig +++ b/exercises/006_strings.zig @@ -24,14 +24,14 @@ 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 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 ++ [_]u8{' '} ++ tom; // That's all the problems. Let's see our results: std.debug.print("d={u} {s}\n", .{ d, major_tom }); |
