What is virtual constructor paradigm?

Answer Posted / subhashish sen

Hi Priyanka Kokil,

What ever u have answered its not 100% correct..As we know
for every virtual function in a class one VTABLE is created
internally and constuctor is an entity who intializes this
VTABLE for all virtual functions of a class.For example if
we have a base class and a derived class derived from
it,then 2 VTABLE will be created one for base and one for
derived class.So if you make constructor as virtual then
who will create VTABLE for this constructor.Thats why
constructor can never be virtual.

Thanks!!!!!If u have ny suggession plz reply..

Is This Answer Correct ?    5 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I learn c++ easily?

624


Do we have to use initialization list in spite of the assignment in constructors?

565


Define macro.

591


What kind of problems can be solved by a namespace?

591


Can user-defined object be declared as static data member of another class?

554






Is there structure in c++?

589


What is implicit conversion/coercion in c++?

657


Why c++ is created?

576


What is command line arguments in C++? What are its uses? Where we have to use this?

580


What is c++ runtime?

656


Explain all the C++ concepts using examples.

686


Is c++ platform dependent?

635


How do I run c++?

576


Who calls main function?

587


What is the difference between structure and class?

562