zig/doc/langref/destructuring_block.zig
LukaTD 0b75a2a1b1
langref: added missing newlines to destructuring tuples example
langref: added missing newlines to destructuring tuples example
2025-09-10 02:31:20 +00:00

23 lines
461 B
Zig

const print = @import("std").debug.print;
pub fn main() void {
const digits = [_]i8 { 3, 8, 9, 0, 7, 4, 1 };
const min, const max = blk: {
var min: i8 = 127;
var max: i8 = -128;
for (digits) |digit| {
if (digit < min) min = digit;
if (digit > max) max = digit;
}
break :blk .{ min, max };
};
print("min = {}\n", .{ min });
print("max = {}\n", .{ max });
}
// exe=succeed