Practice ยท 1 of 3
Create and Destroy
Implement DArray* da_create(int cap) returning a heap-allocated DArray whose data is a heap array of cap ints (size 0), or NULL for cap <= 0 or allocation failure. Implement void da_destroy(DArray *a) freeing data and the struct itself (NULL-safe).
Difficulty: beginner
Press Submit to check your solution.
Back to lesson: Practice: Dynamic Array Build