#include <iostream>
using namespace std;
class A
{
public:
//virtual void f()
//{
// cout << "this is A " <<endl;
//}
};
class B:public A
{
public:
void f()
{
cout<<"this is B "<<endl;
}
};
int main()
{
A *b = new B;
b->f();
delete b;
return 0;
}
为什么b不可以调用f()呢 ? |