Zig course

Zig Level 2: Pointers & Memory

Pointers & Memory is level 2 of 11 of the LoWisa Zig course. It has 3 lessons and 9 ideas. Below is every lesson and what it teaches, in one line each.

Updated 2026-11-25

Pointers

  • Single-item pointers. A pointer type says its shape: one item, many items, sentinel-terminated: each distinct.
  • Optional pointers. Nullable pointers are optionals: a pointer that may be null, its absence typed and dereference checked.
  • Alignment in types. Pointer types carry alignment: the machine reality visible in the signature.

Slices

  • Slices. A slice is a pointer plus length: []u8: the bounds-checked view Zig passes everywhere.
  • Slicing arrays. Arrays slice with ranges: items[2..5]: views without copies.
  • Sentinels. A sentinel-terminated slice ([:0]u8) speaks C-string: the boundary type for interop.

Memory Representation

  • structs and layout. Zig structs lay out predictably: packed and extern variants pinning exact layouts.
  • Endianness and bytes. Byte-level work is explicit: std.mem reading integers with named endianness.
  • comptime-known sizes. @sizeOf and friends are compile-time answers: layout inspected as you design it.

Before and after this level

In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See Checkpoints and flashcards.

Frequently asked questions

What does Zig Level 2: Pointers & Memory cover?

Pointers, Slices, Memory Representation: 3 lessons and 9 ideas.

What should I know before this level?

The level before it, Level 1: Zig Foundations, which covers Types and Values, Control Flow, Functions.

Learn Zig on your phone

The first level is free. LoWisa is on Google Play and the App Store.