0PricingLogin
Zig Academy · Lesson

Fixed-Size Arrays

Declare and index compile-time sized arrays.

What an Array Holds

An array stores a fixed number of values of the same type, laid out one after another in a single block of memory. 📦

The Length Is Fixed

In Zig the length is part of the array's type and is decided at compile time. It can never grow or shrink once declared.

All lessons in this course

  1. Fixed-Size Arrays
  2. Slices: A Pointer Plus a Length
  3. Slicing with array[start..end]
  4. Iterating and Mutating Slices
← Back to Zig Academy