C++20 sections · 1024 units
Open in Course

Quiz: new and delete

Knowledge check

Check Your Understanding

What happens if you use delete instead of delete[] on an array allocated with new[]?

  1. A.Undefined behavior, possibly partial deallocation or crash
  2. B.Only the first element is freed, rest are leaked
  3. C.Compiler error prevents compilation
  4. D.The program frees the entire array correctly
Start the roadmap to answer the quizzes and solve the challenges