# Zig Level 2: Pointers & Memory

> Level 2: Pointers & Memory of the LoWisa Zig course: Pointers, Slices, Memory Representation. 3 lessons and 9 ideas, each explained in one line.

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

## 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

- **Before:** [Level 1: Zig Foundations](/courses/zig/level-1-zig-foundations/): Types and Values, Control Flow, Functions.
- **Next:** [Level 3: Allocators](/courses/zig/level-3-allocators/): Explicit Allocation, Allocator Interfaces, Designing Memory Ownership.

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](/help/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.

---

Source: https://lowisa.dev/courses/zig/level-2-pointers-and-memory/ · Updated 2026-11-25
