← Back to archive

Stdle #173 · structs · 2026-11-26

What does this Zig snippet output?

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

const std = @import("std");
const Point = struct {
x: i32,
y: i32 = 10,
};
pub fn main() void {
const p = Point{ .x = 3 };
std.debug.print("{d} {d}\n", .{ p.x, p.y });
}
Structs
4 attempts left

Answer & explanation