What happens in diamond problem which lead us to ambiguity? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What happens in diamond problem which lead us to ambiguity?

what makes the ambiguity when we dont inherit the classes virtually? https://code.sololearn.com/cD7Y0F3o0UZW/?ref=app

23rd Apr 2018, 8:01 AM
Saqib Naseeb
Saqib Naseeb - avatar
4 Answers
+ 1
https://www.cprogramming.com/tutorial/virtual_inheritance.html
23rd Apr 2018, 9:17 AM
MO ELomari
0
inherit by a non-virtual class make possible diamond problem because compiler dont know which method call (either super class inerith by base class though you dont override they)
23rd Apr 2018, 8:34 AM
KrOW
KrOW - avatar
0
you mean the overridden functions??
23rd Apr 2018, 11:44 AM
Saqib Naseeb
Saqib Naseeb - avatar
0
A code is better than 1000 words :) https://code.sololearn.com/cK1wVF5rxldO/?ref=app
23rd Apr 2018, 1:52 PM
KrOW
KrOW - avatar