Probleme of inheritance 🥺💔 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

Probleme of inheritance 🥺💔

If I have a class derived from two classes base And I have a pointer of first base How I can reach the second base from this pointer? I have used type casting but it gave me wrong values Note: I don't want to make a base clase of two bases I have

20th Dec 2019, 5:36 PM
Rama Rehawi
Rama Rehawi - avatar
2 Answers
+ 2
Interesting question, may I suggest a few things though? * No need for @ in the tags, a simple 'C++ class inheritance' will do fine. * Write readable text for the question title. FYI, title and tags are the ones usable by search feature. So you might wanna make them be clear and relevant. (Edit) Tags and title updated Thank you for understanding 👍
20th Dec 2019, 5:46 PM
Ipang
+ 2
I found a solution to the problem .... I found that there is a difference between static casting and dynamic casting I understood that dynamic casting is useful for converting at runtime unlike static cast
21st Dec 2019, 1:43 PM
Rama Rehawi
Rama Rehawi - avatar