change empty init to '???' placeholder

pull/2/head
Sean Aubin 2 years ago
parent 484822a8da
commit be87134397

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

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

Loading…
Cancel
Save