ziglings/patches/patches/067_comptime2.patch
2023-11-21 15:22:36 +01:00

11 lines
404 B
Diff

--- exercises/067_comptime2.zig 2023-11-21 14:36:12.080295365 +0100
+++ answers/067_comptime2.zig 2023-11-21 15:11:50.814098876 +0100
@@ -35,7 +35,7 @@
// In this contrived example, we've decided to allocate some
// arrays using a variable count! But something's missing...
//
- var count = 0;
+ comptime var count = 0;
count += 1;
const a1: [count]u8 = .{'A'} ** count;