Open Source Your Knowledge, Become a Contributor
Technology knowledge has to be shared and made accessible for free. Join the movement.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#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;
}
Enter to Rename, Shift+Enter to Preview
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