096_memory_allocation.patch 416 B

1234567891011
  1. --- exercises/096_memory_allocation.zig 2023-10-03 22:15:22.125574535 +0200
  2. +++ answers/096_memory_allocation.zig 2023-10-05 20:04:07.276104333 +0200
  3. @@ -64,7 +64,7 @@
  4. const allocator = arena.allocator();
  5. // allocate memory for this array
  6. - var avg: []f64 = ???;
  7. + var avg: []f64 = try allocator.alloc(f64, arr.len);
  8. runningAverage(arr, avg);
  9. std.debug.print("Running Average: ", .{});