mirror of
https://codeberg.org/ziglings/exercises.git
synced 2025-12-27 16:05:37 +00:00
Merge pull request 'Update zig homepage example in 103' (#336) from nkhl/exercises:103-update-homepage-example into main
Reviewed-on: https://codeberg.org/ziglings/exercises/pulls/336
This commit is contained in:
commit
bb4e984a8e
|
|
@ -48,15 +48,14 @@
|
||||||
// // In order to be able to process the input values,
|
// // In order to be able to process the input values,
|
||||||
// // memory is required. An allocator is defined here for
|
// // memory is required. An allocator is defined here for
|
||||||
// // this purpose.
|
// // this purpose.
|
||||||
// const ally = std.testing.allocator;
|
// const gpa = std.testing.allocator;
|
||||||
//
|
//
|
||||||
// // The allocator is used to initialize an array into which
|
// // An array into which the numbers are stored is initialized.
|
||||||
// // the numbers are stored.
|
// var list: std.ArrayList(u32) = .empty;
|
||||||
// var list = std.ArrayList(u32).init(ally);
|
|
||||||
//
|
//
|
||||||
// // This way you can never forget what is urgently needed
|
// // This way you can never forget what is urgently needed
|
||||||
// // and the compiler doesn't grumble either.
|
// // and the compiler doesn't grumble either.
|
||||||
// defer list.deinit();
|
// defer list.deinit(gpa);
|
||||||
//
|
//
|
||||||
// // Now it gets exciting:
|
// // Now it gets exciting:
|
||||||
// // A standard tokenizer is called (Zig has several) and
|
// // A standard tokenizer is called (Zig has several) and
|
||||||
|
|
@ -73,7 +72,7 @@
|
||||||
// const n = try parseInt(u32, num, 10);
|
// const n = try parseInt(u32, num, 10);
|
||||||
//
|
//
|
||||||
// // Finally the individual values are stored in the array.
|
// // 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,
|
// // For the subsequent test, a second static array is created,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user