Back
Close

SHL

Anonymous
1,216 views

#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

Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants