-1

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

Sijith
  • 3,740
  • 17
  • 61
  • 101

1 Answers1

0

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() or C::f() to specify which one you want to use. If you use virtual inheritance you can use just f().

See my answer here for details

Community
  • 1
  • 1
Brian R. Bondy
  • 339,232
  • 124
  • 596
  • 636