Values & References5 / 18
Up next

Single-item pointers

const std = @import("std");

pub fn main() void {
    var n: i32 = 10;
    // *T is a pointer to a single value of type T
    const p: *i32 = &n;
    // write through the pointer with .*
    p.* = 20;
    std.debug.print("{d}\n", .{n});
}
What you're solving

*T points at one value