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
Is c++ low level?
program explaining feautures of c++
How to allocate memory dynamically for a reference?
Difference between an inspector and a mutator
How do you declare a set in c++?
What is time h in c++?
What is the c++ programming language used for?
What do you mean by enumerated data type?
How are the features of c++ different from c?
What do you mean by delegate? Can a user retain delegates?
What is a storage class?
What is #include sstream?
Write a program which uses functions like strcmp(), strcpy()? etc
What is #include cmath?
what are the iterator and generic algorithms.