3 ms·
Because it's not Rust/C. And it does have some nifty features like tagged unions and comptime. Here is Zig UB in a nutshell const std = @import("std");
by Ygg2 3y ago
Because it's not Rust/C. And it does have some nifty features like tagged unions and comptime.
Here is Zig UB in a nutshell
const std = @import("std");
pub fn main() !void {
const warning1 = try powerLevel(9000);
const warning2 = try powerLevel(10);
std.debug.print("{s}\n", .{warning1});
std.debug.print("{s}\n", .{warning2});
}
fn powerLevel(over: i32) ![]u8 {
var buf: [20]u8 = undefined;
return std.fmt.bufPrint(&buf, "over {d}!!!", .{over});
}