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
How can you quickly find the number of elements stored in a a) static array b) dynamic array ? Why is it difficult to store linked list in an array?how can you find the nodes with repetetive data in a linked list?
Please explain the reference variable in c++?
What do the header files usually contains?
How the endl and setw manipulator works?
How do I start a c++ project?
How are virtual functions implemented in c++?
How do c++ struct differs from the c++ class?
If a base class declares a function to be virtual, and a derived class does not use the term virtual when overriding that class, is it still virtual when inherited by a third-generation class?
How are pointers type-cast?
What are the differences between java and c++?
Can char be a number c++?
Explain the scope of resolution operator.
What is the role of static keyword for a class member variable?
Comment on assignment operator in c++.
What is c++ manipulator?