Question 11
Back to Exercise
How must int* a = new int[10]; be released?
- A delete a;
- B delete[] a; Correct
- C free(a);
- D It is freed automatically
Correct Answer: Option B
new[] pairs with delete[]. Mixing the forms – or with free – is undefined behaviour.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!