#include <iostream>
using namespace std;
class A {
public:
A() { f("A()"); }
~A() { f("~A()"); }
protected:
virtual void f(const char* str) = 0;
};
class B : public A {
public:
B() { f("B()"); }
~B() { f("~B()"); }
protected:
void f(const char* str) { cout<< str << endl; }
};
int main() {
B b;
return 0;
}
Login in to like
Login in to comment