Answer Posted / guest
Any class that may act as the base of another class should
have a virtual destructor. This ensures that when an object
of the derived class is destroyed that the derived class
dtor will be invoked to destroy it. If the destructor is not
virtual, under some common circumstances, only the base
class' destructor will be invoked, regardless of the class
actually being destroyed. For practical purposes this means
that a class which does, could or should have virtual member
functions, should also have a virtual destructor.
| Is This Answer Correct ? | 18 Yes | 3 No |
Post New Answer View All Answers
what's the basic's in dot net
write a program to find 2^n+1 ?
Can static class have constructor?
Is oop better than procedural?
What is ambiguity in inheritance?
What is an advantage of polymorphism?
Get me a number puzzle game-program
What is destructor oops?
when to use 'mutable' keyword and when to use 'const cast' in c++
write a programe to calculate the simple intrest and compund intrest using by function overlading
What makes a language oop?
Please send ford technologies placement paper 2 my mail id
write a C++ program for booking using constructor and destructor.
What are the 4 pillars of oop?
What is object and example?