mirror of
https://codeberg.org/andyscott/ziglings.git
synced 2024-12-22 14:03:10 -05:00
change empty init to '???' placeholder
This commit is contained in:
parent
484822a8da
commit
be87134397
2 changed files with 3 additions and 3 deletions
|
@ -61,8 +61,8 @@ pub fn main() !void {
|
||||||
// initialize the allocator
|
// initialize the allocator
|
||||||
const allocator = arena.allocator();
|
const allocator = arena.allocator();
|
||||||
|
|
||||||
// allocate memory for this array instead of empty initialization
|
// allocate memory for this array
|
||||||
var avg: []f64 = {};
|
var avg: []f64 = ???;
|
||||||
|
|
||||||
runningAverage(arr, avg);
|
runningAverage(arr, avg);
|
||||||
std.debug.print("Running Average: ", .{});
|
std.debug.print("Running Average: ", .{});
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
65c65
|
65c65
|
||||||
< var avg: []f64 = {};
|
< var avg: []f64 = ???;
|
||||||
---
|
---
|
||||||
> var avg: []f64 = try allocator.alloc(f64, arr.len);
|
> var avg: []f64 = try allocator.alloc(f64, arr.len);
|
||||||
|
|
Loading…
Reference in a new issue