Answer Posted / mukesh kumar
To Remove the ambguity problem in multiple inheritance we
make the base class as vitual that means it will make only
one copy its common data member.
EX: suppose we have a base class A , which have a data
member x as integer.
class b: virtual public A
{
};
class C : virtual public A
{
};
class d: public B,public C
{
}
without making classes A and B as virtual class d had two
copies of x.This will arised ambguity problem.
| Is This Answer Correct ? | 38 Yes | 4 No |
Post New Answer View All Answers
What exactly is polymorphism?
What does obj stand for?
What is encapsulation in oops?
Why do we use inheritance?
Tell me an example where stacks are useful?
Can I learn c++ without knowing c?
What are disadvantages of pointers?
Does c++ have finally?
Explain this pointer?
What is #include c++?
What are the differences between the function prototype and the function defi-nition?
Write a program to implement OOPS concepts such as inheritance, polymorphism, friend function, operator overloading?
What is operator overloading in c++ example?
Why it is called runtime polymorphism?
What is a c++ map?