diff options
| author | Nikhil <nikhil.kamineni@gmail.com> | 2025-12-14 18:12:51 -0800 |
|---|---|---|
| committer | Nikhil <nikhil.kamineni@gmail.com> | 2025-12-14 18:12:51 -0800 |
| commit | 82d5dda2736d2b6c7d93c4bc2b14a4a9d5b4a5eb (patch) | |
| tree | 4c4a7c020cbf67a727db6f6c04a83aebbf8fba48 /exercises | |
| parent | 2ffc3ee1d806c24b82a037f1a24ecb392c580a1c (diff) | |
Update zig homepage example in 103
Diffstat (limited to 'exercises')
| -rw-r--r-- | exercises/103_tokenization.zig | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/exercises/103_tokenization.zig b/exercises/103_tokenization.zig index 6f71177..972e8e8 100644 --- a/exercises/103_tokenization.zig +++ b/exercises/103_tokenization.zig @@ -48,15 +48,14 @@ // // In order to be able to process the input values, // // memory is required. An allocator is defined here for // // this purpose. -// const ally = std.testing.allocator; +// const gpa = std.testing.allocator; // -// // The allocator is used to initialize an array into which -// // the numbers are stored. -// var list = std.ArrayList(u32).init(ally); +// // An array into which the numbers are stored is initialized. +// var list: std.ArrayList(u32) = .empty; // // // This way you can never forget what is urgently needed // // and the compiler doesn't grumble either. -// defer list.deinit(); +// defer list.deinit(gpa); // // // Now it gets exciting: // // A standard tokenizer is called (Zig has several) and @@ -73,7 +72,7 @@ // const n = try parseInt(u32, num, 10); // // // Finally the individual values are stored in the array. -// try list.append(n); +// try list.append(gpa, n); // } // // // For the subsequent test, a second static array is created, |
