Explain calling an object's member function(declared
virtual)from its constructor?
Answer / 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 |
What are containers in c++?
What is virtual table?
What is a Default constructor?
When is the destructor called?
What do you mean by stack unwinding in c++?
Are strings mutable in c++?
What is the type of 'this' pointer?
What is an operator in c++?
What are enumerations?
What is split a string in c++?
What is the difference between static link library and dynamic link library?
Which programming language is best to learn first?