Memory
Subcategories
Checkpoints
- `const` Bindings Essential A `const` binding declares a true compile-time constant — its value is computed at compile time and substituted at each use site. You'll see how `const` differs from `let` (no runtime address, no `mut`, requires a type annotation), what kinds of expressions are allowed in a `const` initializer, and when to reach for `const` versus an immutable `let`.
- `static` Variables Essential A `static` declares a single value that lives in the program's data segment for the entire run of the program. Unlike `const`, a `static` has a fixed memory address you can take a reference to. You'll see when to use `static` (large read-only tables, program-wide handles), why mutable `static`s require `unsafe`, and how `static`s relate to the data region of memory you learned in the Zig course.