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
Explain the operation of overloading of an assignment operator.
Can constructor be static in c++?
Are iterators pointers?
What is the difference between an external iterator and an internal iterator? Describe an advantage of the external iterator.
What does catch(…) mean?
Write some differences between an external iterator and an internal iterator?
Write about the local class and mention its use?
What is c++ array?
What is java and c++?
Explain the problem with overriding functions
What is a list c++?
Is there any function that can skip certain number of characters present in the input stream?
What is the latest version on c++?
Write a program to add three numbers in C++ utilizing classes.
How the endl and setw manipulator works?