Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pub fn main() !void {
- var str: [4]u8 = undefined;
- var a = 5;
- str[1] = if (a > 5) 'a' - 10 else '0';
- }
- ./test.zig:3:5: error: variable of type 'comptime_int' must be const or comptime
- var a = 5;
- ^
- ./test.zig:4:18: note: referenced here
- str[1] = if (a > 5) 'a' - 10 else '0';
- ^
- /usr/lib/zig/std/start.zig:334:40: note: referenced here
- const result = root.main() catch |err| {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement