Explain calling an object's member function(declared
virtual)from its constructor?
Answer Posted / deepak
It will depend on when pointer to vtable is initialised.
generally if constructor is already defined compiler insert
code to initialise virtual table pointer as first statement
inside defined constructor. If vptr is initialised before
calling virtual function then it will be invoked, if vptr is
not initialised then it can crash.
Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is data binding in c++?
Explain the auto storage classes in c++.
Define anonymous class.
what are the iterator and generic algorithms.
Define copy constructor.
How do you add an element to a set in c++?
What is c++ in english?
Why c++ is better than c language?
What is a v-table?
How is objective c different from c++?
How do we balance an AVL Tree in C++?
What does 7/9*9 equal ? a) 1 b) 0.08642 c) 0
What is the most common mistake on c++ and oo projects?
Why is swift so fast?
Can a class be static in c++?