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 are the types of pointer?
Why the usage of pointers in C++ is not recommended ?
Will a C compiler always compile C++ code a) Yes b) No c) Only optimized compilers
What do you mean by abstraction in C++?
Which is the best c++ compiler?
Write a program to swap 2 chars without using a third varable? char *s = "A"; char *p = "B";
What parameter does the constructor to an ofstream object take?
What is a hash function c++?
When is the last time you coded in C/C++? What is the most lines of original C/C++ code you have personally written in one project? How confident are you in your ability to write C or C++ without a reference?
What are the rules about using an underscore in a c++ identifier?
Are there any new intrinsic (built-in) data types?
What is vector pair in c++?