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 is a hash function c++?
Give an example of run-time polymorphism/virtual functions.
What is the full name of logo?
without if else statement can be written ah
Explain what are accessor methods?
Difference between struct and class in terms of access modifier.
How is modularity introduced in C++?
What are the different types of comments allowed in c++?
What does new in c++ do?
Define token in c++.
What is a local reference?
Explain about Virtual Function in C++?