Answer Posted / hrpynux@gmail.com
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 |
Post New Answer View All Answers
Will a C compiler always compile C++ code a) Yes b) No c) Only optimized compilers
What is a loop? What are different types of loops in c++?
Why do we learn c++?
What kind of problems can be solved by a namespace?
Should you pass exceptions by value or by reference?
How c functions prevents rework and therefore saves the programers time as wel as length of the code ?
What is the best free c++ compiler for windows?
What are the basics of local (auto) objects?
Write a program using merge () function to combine the elements of array x[ ] and y[ ] into array z[ ].
How do you remove an element from a set in c++?
Write about the stack unwinding?
Which software is best for coding?
If there are two catch statements, one for base and one for derived, which should come first?
When one must use recursion function? Mention what happens when recursion functions are declared inline?
How to implement is-a and has-a class relationships?