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 |
Why is c++ so fast?
What does '\r' and '\b' mean? Please explain with example.
Ask to write virtual base class code?
What is std namespace in c++?
What is a constructor initializer list and when we use constructor initializer list?
What is c++ and its uses?
What is ofstream c++?
Can constructor be private in c++?
Why is c++ still best?
What is pointer in c++ with example?
Carry out conversion of one object of user-defined type to another?
write a programming using for loop in c++ to generate diamond trangel?