Files
ziglings/patches/patches/099_memory_allocation.patch
2026-04-03 13:35:56 +02:00

12 lines
420 B
Diff

--- exercises/099_memory_allocation.zig 2025-08-15 15:17:57.839348063 +0200
+++ answers/099_memory_allocation.zig 2026-04-03 13:09:47.403580391 +0200
@@ -64,7 +64,7 @@
const allocator = arena.allocator();
// allocate memory for this array
- const avg: []f64 = ???;
+ const avg: []f64 = try allocator.alloc(f64, arr.len);
runningAverage(arr, avg);
std.debug.print("Running Average: ", .{});