What is ambiguity in inheritance?


Warning: Trying to access array offset on false in /home3/indiakep/public_html/wp-content/plugins/dw-question-answer/inc/Template.php on line 8
All QuestionsCategory: Cpp LanguageWhat is ambiguity in inheritance?
Chetan Shidling Staff asked 6 years ago

I need short information.

1 Answers
Chetan Shidling Staff answered 6 years ago

The ambiguity occurs when a function with the same name appears in more than one base class or appears in both base and derived class.

Class M
{
public:
void display() {cout<<“\n class M”;}
};

class N
{
public:
void display() { cout << “\n class N”; }
};
class P : public M, public N