class Base {
public:
void virtual func() {
cout << "父类func()" << endl;
}
};
class Son : public Base {
public:
void func() {
cout << "子类func()" << endl;
}
};
//void doFunc(Base& b) {
// b.func();
//}
void text() {
Son s;
//doFunc(s);
s.func();
}
int main() {
text();
system("pause");
return 0;
}
一只萌萌小番薯