Which option is best to eliminate the memory problem?
A. use smart pointers
B. use raw pointers
C. use virtual destructor
D. both a & c
Answer:A
Which option is best to eliminate the memory problem?
A. use smart pointers B. use raw pointers C. use virtual destructor D. both a & c
Explanation: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.