mirror of
https://codeberg.org/ziglings/exercises.git
synced 2025-01-28 01:16:02 +00:00
11 lines
416 B
Diff
11 lines
416 B
Diff
--- exercises/096_memory_allocation.zig 2023-10-03 22:15:22.125574535 +0200
|
|
+++ answers/096_memory_allocation.zig 2023-10-05 20:04:07.276104333 +0200
|
|
@@ -64,7 +64,7 @@
|
|
const allocator = arena.allocator();
|
|
|
|
// allocate memory for this array
|
|
- var avg: []f64 = ???;
|
|
+ var avg: []f64 = try allocator.alloc(f64, arr.len);
|
|
|
|
runningAverage(arr, avg);
|
|
std.debug.print("Running Average: ", .{});
|