What is virtual constructor paradigm?

Answer Posted / priyanka kokil

A virtual destructor is one that is declared as virtual in
the base class and is used to ensure that destructors are
called in the proper order. It is to be remembered that
destructors are called in the reverse order of inheritance.
If a base class pointer points to a derived class object
and we some time later use the delete operator to delete
the object, then the derived class destructor is not called.

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a v-table?

640


How do you define a class in c++?

637


What is the use of setprecision in c++?

535


Does there exist any other function which can be used to convert an integer or a float to a string?

643


How do I tokenize a string in c++?

601






Do vectors start at 0?

588


What will strcmp("Astring", "Astring"); return a) A positive value b) A negative value c) Zero

630


Is java as fast as c++?

593


If dog is a friend of boy, is boy a friend of dog?

565


why is c++ called oops? Explain

576


What is the use of default constructor?

564


What is size_type?

537


Can c++ be faster than c?

592


Would you rather wait for quicksort, linear search, or bubble sort on a 200000 element array? (Or go to lunch...) a) Quicksort b) Linear Search c) Bubble Sort

626


What will happen if a pointer is deleted twice?

716