S
sun1991
#include <iostream>
using namespace std;
class Base{
public:
void ToString(){
ToStringCore();
}
private:
virtual void ToStringCore(){
cout << "this is Base" << endl;
}
};
class Derived: public Base{};
int main(){
Derived d;
d.ToString();
}
using namespace std;
class Base{
public:
void ToString(){
ToStringCore();
}
private:
virtual void ToStringCore(){
cout << "this is Base" << endl;
}
};
class Derived: public Base{};
int main(){
Derived d;
d.ToString();
}