What is virtual destructors? Why they are used?
Virtual destructors in C++ are used to avoid memory leaks especially when your class contains unmanaged code, i.e., contains pointers or object handles to files, databases or other external objects. A destructor can be virtual. ... Now, suppose you create an instance of the Derived class using a Base class pointer.
| Is This Answer Correct ? | 0 Yes | 0 No |
What's the hardest coding language?
What is Name Decoration?
Explain the ISA and HASA class relationships. How would you implement each in a class design?
How do you invoke a base member function from a derived class in which you have not overridden that function?
What are the effects after calling the delete this operator ?
Why isn't sizeof for a struct equal to the sum of sizeof of each member?
Define the process of handling in case of destructor failure?
What is constant in c++ with example?
How to write a program such that it will delete itself after exectution?
What is enum c++?
Which recursive sorting technique always makes recursive calls to sort subarrays that are about half size of the original array?
Is c++ a pure oop language?