How do you fix diamond problems?

The solution to the diamond problem is to use the virtual keyword . We make the two parent classes (who inherit from the same grandparent class) into virtual classes in order to avoid two copies of the grandparent class in the child class.

Leave a Reply

Your email address will not be published. Required fields are marked *