Answer Posted / chandra
Vtable consists of function pointers pointing to the
virtual functions of their respective class.
Ex: Class A
{
public:
virtual void fun1();
virtual void fun2();
};
Class B: public A
{
public:
Virtual void fun2();
};
Now there will be 2 vtables created for the 2 classes. in
first vtable there will be 2 function pointers pointing to
fun1 and fun2.
one more vtable is created for the class B. in which this
vtable also consists of two function pointers because class
B is derived from class A. so all the functions are
derived . so in this vtable two function pointers are
present. one function pointer pointing to fun1 and one more
function pointer pointing to fun2 of derived class.
Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
What is abstraction example?
Can abstract class have normal methods?
how to get the oracle certification? send me the answer
What is stream in oop?
What is class and example?
write a code for this:trailer recordId contains a value other than 99, then the file must error with the reason ‘Invalid RECORD_ID’(User Defined Exception).
What is difference between multiple inheritance and multilevel inheritance?
What is encapsulation c#?
String = "C++ is an object oriented programming language.An imp feature of oops is classes and objects".Write a pgm to count the repeated words from this scenario?
State what is encapsulation and friend function?
What is destructor oops?
What is polymorphism and types?
What is the main feature of oop?
Why is object oriented programming so hard?
What are the 3 principles of oop?