MCPcopy Create free account
hub / github.com/EricPengShuai/Interview / Base

Class Base

base_code/pure_virtual.cpp:4–14  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2using namespace std;
3
4class Base
5{
6protected:
7 int x;
8public:
9 virtual void fun() = 0; // 纯虚函数
10 explicit Base(int i) { x = i; }
11 virtual ~Base() {
12 cout << "Destructor: Base." << endl;
13 }
14};
15
16class Derived: public Base
17{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected