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 oops and its features?
Why polymorphism is used in oops?
How to hide the base class functionality in Inheritance?
What is the importance of oop?
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).
How is polymorphism achieved?
write a program using c++ to implement single contiguous memory mangement techniques.display the content of the main memory after yhe allocation of jobs and percentage of the wastage of the main memory
What is property in oops?
Why is object oriented programming so hard?
write a program to find 2 power of a 5digit number with out using big int and exponent ?
What is overriding vs overloading?
Is this job good for future? can do this job post grduate student?
What is polymorphism oop?
write a program to find 2^n+1 ?
What is stream in oop?