C++20 sections · 1024 units
Open in Course

Quiz: Memory Leaks

Knowledge check

Check Your Understanding

Which code leaks memory?

  1. A.int* p = new int(5); p = new int(10); delete p;
  2. B.int* p = new int(5); delete p;
  3. C.int* p = new int(5); delete p; p = nullptr;
  4. D.int x = 5; int* p = &x;
Start the roadmap to answer the quizzes and solve the challenges