Fill Then Scale
Challenge on lesson: Checkpoint: Dynamic Memory
CHALLENGE
Difficulty: beginner+25 XP
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.
Press Submit to check your solution.
Back to lesson: Checkpoint: Dynamic Memory