mirror of
https://codeberg.org/ziglings/exercises.git
synced 2024-12-26 09:30:31 +00:00
7679f93f68
This is checked from compiler version 0.12.0-dev.1664
11 lines
420 B
Diff
11 lines
420 B
Diff
--- exercises/096_memory_allocation.zig 2023-11-21 14:55:33.805678390 +0100
|
|
+++ answers/096_memory_allocation.zig 2023-11-21 14:56:00.236163484 +0100
|
|
@@ -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: ", .{});
|