Values & References11 / 18
Up next

Pointer to a struct

const std = @import("std");

const Point = struct { x: i32, y: i32 };

pub fn main() void {
    var p = Point{ .x = 1, .y = 2 };
    const pp = &p;
    // no explicit .* needed: pp.x means pp.*.x
    pp.x = 10;
    std.debug.print("{d} {d}\n", .{ p.x, p.y });
}
What you're solving

field access auto-dereferences