Answer Posted / suresh.k (portblair)
Using virtual destructors, you can destroy objects without
knowing their type - the correct destructor for the object
is invoked using the virtual function mechanism. Note that
destructors can also be declared as pure virtual functions
for abstract classes.
if someone will derive from your class, and if someone will
say "new Derived", where "Derived" is derived from your
class, and if someone will say delete p, where the actual
object's type is "Derived" but the pointer p's type is your
class.
| Is This Answer Correct ? | 2 Yes | 4 No |
Post New Answer View All Answers
What is encapsulation oop?
How do you use inheritance in unity?
How oops is better than procedural?
What is the full form of oops?
What is a class and object?
Give an example where we have to specifically use C programming language and C++ programming language cannot be used?
What is coupling in oops?
Why do we use inheritance?
Write a program to implement OOPS concepts such as inheritance, polymorphism, friend function, operator overloading?
What is data binding in oops?
What is encapsulation c#?
What is polymorphism used for?
What is super in oop?
They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?
What is a class oop?