fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Super{
  5. public:
  6. void Test()
  7. {
  8. cout<<"Test"<<endl;
  9. }
  10. };
  11. class A:public Super{};
  12. class B:public Super{};
  13. class C:public Super{};
  14. class Mega:public A,public B,public C{};
  15.  
  16. int main() {
  17. Super* s=(A*)new Mega();
  18. s->Test();
  19. delete s;
  20. return 0;
  21. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
Test