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

What is the best ide for c++?

566


Is c++ the hardest programming language?

634


write a c++ program to create class student having datamember name,Roll_no,age,and branch intilcization all the member using constructor print the all the details on the screen.

2245


What is else if syntax?

673


What is c++ virtual inheritance?

595






What is meant by forward referencing and when should it be used?

550


When are exception objects created?

607


Can a program run without main in c++?

583


What is the correct syntax for inheritance a) class aclass : public superclass b) class aclass inherit superclass c) class aclass <-superclass

681


How is computer programming useful in real life?

594


How do you decide which integer type to use?

573


explain the reference variable in c++?

571


Explain linear search.

630


Should I learn c or c++ first?

564


Is python better than c++?

584