Practice · 1 of 4
Allocate 1..n
CHALLENGE
Difficulty: beginner+25 XP
Implement int* ints_up_to(int n) returning a heap-allocated array holding 1,2,...,n. Return NULL for n <= 0. The CALLER frees it.
Press Submit to check your solution.
Back to lesson: Practice: Allocation Workbench