SHL

Anonymous
1,625 views

Open Source Your Knowledge, Become a Contributor

Technology knowledge has to be shared and made accessible for free. Join the movement.

Create Content

#include <iostream>
using namespace std;
class Base {
public:
Base() { cout << "Base() called" << endl;
}
};
class S1:public Base {
public:
S1() { cout << "S1() called" << endl;}
};
class S2:public virtual Base {
public:
S2() { cout << "S2() called" << endl;}
};
class M : public S1, public S2 {
public:
M() { cout << "M() called" << endl;}
};
int main()
{
M mm;
return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Advanced usage

If you want a more complex example (external libraries, viewers...), use the Advanced C++ template

Open Source Your Knowledge: become a Contributor and help others learn. Create New Content