← Back to archive

Stdle #156 · structs · 2026-11-09

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 T = packed struct { a: u3, b: u3, c: u2 };
std.debug.print("{d}\n", .{@sizeOf(T)});
std.debug.print("{d}\n", .{@bitSizeOf(T)});
}
Structs
2 lines
4 attempts left

Answer & explanation