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

Is c++ fully object oriented?

545


Write a program for Divide a number with 2 and Print the output ( NOTE: Check for divide by zero error).

625


Who discovered c++?

552


Is dev c++ free?

606


What is the real purpose of class – to export data?

607






Write an algorithm that determines whether or not an almost complete binary tree is a heap.

3421


Which programming language's unsatisfactory performance led to the discovery of c++?

790


What are references in c++?

645


How many static variables are created if you put one static member into a template class definition?

558


Why do you use the namespace feature?

637


What are inline functions? What is the syntax for defining an inline function?

571


How many different levels of pointers are there?

647


If I is an integer variable, which is faster ++i or i++?

582


Is c++ a difficult language?

563


program explaining feautures of c++

1908