typeover
curriculum

Curriculum Types Pointers exercise 5 · fill-word

Pointers

Fill the two-character postfix sequence that DEREFERENCES a pointer. Read it as the inverse of & — "the thing pointed at."

TypeScript reference
Fill the blanks →

About this theme

TypeScript has no pointer syntax — everything is a reference under the hood. Zig has dedicated syntax for pointers, and several flavours: *T (single pointer to one T), *const T (read-only single pointer), and — surfaced later in the curriculum — [*]T (many-item pointer, length unknown) and ?*T (nullable single pointer). This theme focuses on the two-flavour core (*T + *const T) since those are the shapes you write every day; many-item and nullable pointers come up in Module 3 (memory) and Module 4 (errors) respectively when their natural use cases arrive. &value takes the address; p.* dereferences. The discipline: pick the narrowest flavour that fits the use case.