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 language is a dll written in?
What is an inclusion guard?
what is the difference between linear list linked representaion and linked representation? what is the purpose of representing the linear list in linked represention ? is it not avoiding rules of linear represention?
Can I have a reference as a data member of a class? If yes, then how do I initialise it?
Do class declarations end with a semicolon? Do class method definitions?
What is difference between rand () and srand ()?
What is problem with overriding functions?
What are the rules for naming an identifier?
How to tokenize a string in c++?
When do you call copy constructors?
What is the most useful programming language?
What is c++ iterator?