Please help me on this puzzle
i have class D inherited fronm class B and class C, these class C and Class D again inherited from class A. In class D i have to access function in class A. is it possible
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes you can and you probably want to use virtual inheritance. If you don’t use virtual inheritance then you’ll need to use
B::f()orC::f()to specify which one you want to use. If you use virtual inheritance you can use justf().See my answer here for details