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
Explain the differences between list x; & list x();.
What is the difference between global variables and local variable
In inline " expression passed as argument are evalauated once " while in macro "in some cases expression passed as argument are evaluated more than once " --> i am not getting it plz help to make me understand....
What is the function of I/O library in C++ ?
How do I use turbo c++?
What is polymorphism and why is it important?
What is a lambda function c++?
What is an object in c++?
What are friend functions in C++?
What is overriding in oops?
Draw a flow chart and write a program for the difference between the sum of elements with odd and even numbers. Two dimensional array.
Explain virtual inheritance?
What is the difference between a constructor and a destructor?
Explain overriding.
What are the 4 pillars of oop?