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 is time h in c++?
What do stl stand for?
What is a modifier in c++?
When did c++ add stl?
How do you declare A pointer to function which receives an int pointer and returns a float pointer
Why do we need constructors in c++?
Is set c++?
Differentiate between C and C++.
What is recursion?
Tell us the size of a float variable.
Explain selection sorting. Also write an example.
What is c++ iterator?
What is problem with overriding functions?
What do you understand by zombie objects in c++?
What are the advantages/disadvantages of using inline and const?