zig/doc/langref/defer_unwind.zig
2025-07-14 17:34:52 +01:00

21 lines
347 B
Zig

const std = @import("std");
const print = std.debug.print;
pub fn main() void {
print("\n", .{});
defer {
print("1 ", .{});
}
defer {
print("2 ", .{});
}
if (false) {
// defers are not run if they are never executed.
defer {
print("3 ", .{});
}
}
}
// exe=succeed