How to construct virtual constructor
Answer Posted / nishant
Firstly Virtual constructor is really not needed at all.
Explanation:
V-table is something which stores the addresses corrospond
to all virtual function within a class.Now every class
object contains virtual pointer points to base address of
v-table in memory which is being used to resolve the
corrosponding virtual function addresses.
This v-table construction is done when object of the class
has been created,While constructor is an initialization
process in construction of the object and so v-table is not
available during initialization process and hence virtual
constructor is not possible.
Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
A mXn matrix is given and rows and column are sorted as shown below.Write a function that search a desired entered no in the matrix .with minimum complexity 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
what are the iterator and generic algorithms.
What is functions syntax in c++?
Explain the differences between private, public and protected and give examples.
What is enum c++?
What are the various operations performed on stack?
Explain how the virtual base class is different from the conventional base classes of the opps.
What are the types of array in c++?
How to defines the function in c++?
what is the use of void main() in C++ language?
Is arr and &arr are same expression for an array?
Why do we use using namespace std in c++?
Do you know what are the new features that iso/ansi c++ has added to original c++ specifications?
What is a character in c++?
What is lazy initialization in c++?