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
Can constructor be static in c++?
What will strcmp("Astring", "Astring"); return a) A positive value b) A negative value c) Zero
Why was c++ created?
What's the "software peter principleā?
What does h mean in maths?
Why cstdlib is used in c++?
Define Virtual function in C++.
Find the Factorial of a number using a program.
What is the protected keyword used for?
Write about the access privileges in c++ and also mention about its default access level?
What is the use of structure in c++?
Is c++ the best programming language?
What is Difeerence between List obj=new ArrayList(); and ArrayList obj=new ArrayList()?
What is polymorphism explain its types?
What does no cap mean?