Skip to main content

Fill Then Scale

Challenge on lesson: Checkpoint: Dynamic Memory

Implement int* make_filled(int n) returning a heap array of n ints filled with 1..n (NULL for n <= 0 or allocation failure), and void scale_all(int *a, int n, int k) multiplying each element by k.

Difficulty: beginner

Back to lesson: Checkpoint: Dynamic Memory