I faced a problem when I made a parent class having two child classes and these two child classes have a common grandchild class but at run-time compiler showed an error of ambiguity then I came to know by a friend that this was a diamond problem. Now I want to know the solution to this problem. I know to solve this we use virtual keyword but is there any more method to resolve this issue.
I tried to make the object of the grandchild class but the compiler showed an error of ambiguity as it it a diamond problem so what should I do? Because I am given a question in test that what are two methods to resolve the diamond problem in c++? I know one is virtual inheritance but what is another method
Muhammad Ahmad is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.