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 |
How would you use the functions randomize() and random()?
What is a smart pointer?
How do you show the declaration of a virtual constructor?
Which operator can not be overloaded in C++?
program in c++ to input digits and print in words
Differentiate between the message and method in c++?
Is it possible to provide special behavior for one instance of a template but not for other instances?
What is the Difference between "C structure" and "C++ structure"?
What is searching?
What does ios :: app do in c++?
Of the numbers 12 23 9 28 which would be at the top of a properly implemented maxheap a) 28 b) 9 c) Any of them could be
State the difference between pre and post increment/decrement operations.