0PricingLogin
Zig Academy · Lesson

Single-Item Pointers with *T

Point at exactly one value.

A Pointer Points

A pointer holds the address of a value living somewhere else in memory, instead of holding the value itself. 📍

The *T Type

A single-item pointer has the type *T, where T is what it points at. So *i32 means a pointer to one i32 value.

var p: *i32 = undefined;

All lessons in this course

  1. Single-Item Pointers with *T
  2. Dereferencing with ptr.*
  3. Many-Item Pointers [*]T
  4. Const Pointers and Alignment
← Back to Zig Academy