Home » C++ Programming » Dynamic Memory » Question
  1. Which option is best to eliminate the memory problem?
    1. use virtual destructor
    2. use smart pointers & virtual destructor
    3. use smart pointers
    4. use raw pointers
    5. None of these
Correct Option: B

Virtual destructor means is that the object is destructed in reverse order in which it was constructed and the smart pointer will delete the object from memory when the object goes out of scope.



Your comments will be displayed only after manual approval.