C++20 sections · 1024 units
Open in CourseQuiz: new and delete
Knowledge check
Check Your Understanding
What happens if you use delete instead of delete[] on an array allocated with new[]?
- A.Undefined behavior, possibly partial deallocation or crash
- B.Only the first element is freed, rest are leaked
- C.Compiler error prevents compilation
- D.The program frees the entire array correctly