← Back to archive

Stdle #140 · arrays · 2026-10-24

What does this Zig snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

const std = @import("std");
pub fn main() void {
const arr = [_]u8{ 1, 2, 3 };
const repeated = arr ++ arr;
std.debug.print("{d}\n", .{repeated.len});
std.debug.print("{d}\n", .{repeated[4]});
}
Arrays
2 lines
4 attempts left

Answer & explanation