1
0
Fork 0
mirror of https://github.com/ratfactor/ziglings synced 2024-05-11 13:46:03 +02:00

change empty init to '???' placeholder

This commit is contained in:
Sean Aubin 2023-03-08 19:22:17 -05:00
parent 482224e616
commit 7cf54cb39f
2 changed files with 3 additions and 3 deletions

View File

@ -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: ", .{});

View File

@ -1,4 +1,4 @@
65c65
< var avg: []f64 = {};
< var avg: []f64 = ???;
---
> var avg: []f64 = try allocator.alloc(f64, arr.len);