Skip to main content

Practice · 1 of 5

Measure the Legal Span

CHALLENGE
Difficulty: advanced+25 XP

Implement size_t legal_span(void): given the file-scope array static int arr[6]; (already in your editor), return how many distinct pointer values arr + k (k = 0..) are *computable* — including the one-past-the-end value. Then implement size_t deref_span(void) returning how many of those are dereferenceable.

Back to lesson: Practice: Pointer Semantics Drills