diff options
author | Sean Aubin <sean@proteinqure.com> | 2023-03-08 19:22:17 -0500 |
---|---|---|
committer | Sean Aubin <sean@proteinqure.com> | 2023-03-08 19:22:17 -0500 |
commit | be87134397d1728b3d98d1229d241254130e0708 (patch) | |
tree | 0b6b82896f16aaa0f42c8e53e85bddf25f1ecd14 | |
parent | 484822a8da1361d5878c82b0f30eafec1e3bc43e (diff) |
change empty init to '???' placeholder
-rw-r--r-- | exercises/096_memory_allocation.zig | 4 | ||||
-rw-r--r-- | patches/patches/096_memory_allocation.patch | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/exercises/096_memory_allocation.zig b/exercises/096_memory_allocation.zig index 057b420..7843b93 100644 --- a/exercises/096_memory_allocation.zig +++ b/exercises/096_memory_allocation.zig @@ -61,8 +61,8 @@ pub fn main() !void { // initialize the allocator const allocator = arena.allocator(); - // allocate memory for this array instead of empty initialization - var avg: []f64 = {}; + // allocate memory for this array + var avg: []f64 = ???; runningAverage(arr, avg); std.debug.print("Running Average: ", .{}); diff --git a/patches/patches/096_memory_allocation.patch b/patches/patches/096_memory_allocation.patch index e13a27a..5398ce5 100644 --- a/patches/patches/096_memory_allocation.patch +++ b/patches/patches/096_memory_allocation.patch @@ -1,4 +1,4 @@ 65c65 -< var avg: []f64 = {}; +< var avg: []f64 = ???; --- > var avg: []f64 = try allocator.alloc(f64, arr.len); |