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 |
Does a derived class inherit or doesn't inherit?
What is an arraylist c++?
What is the difference between global variables and local variable
What is encapsulation in c++?
Explain the difference between 'operator new' and the 'new' operator?
Give 10 points of differences between C & C++.
When does the c++ compiler create temporary variables?
Disadvantages of c++
What is a namespace in c++?
What is nested class in c++?
What is boyce codd normal form in c++?
What is a v-table?