#2
只要半杯水2012-02-24 23:30
|
程序代码:
#include <iostream>
using namespace std;
class test{
public:
void print()
{
cout<<"health tooth"<<endl;
}
};
class obj:public test{
public:
void print()
{
cout<<"bad tooth"<<endl;
}
};
int main()
{
test* point= &obj;
(obj*)point->print();
}
using namespace std;
class test{
public:
void print()
{
cout<<"health tooth"<<endl;
}
};
class obj:public test{
public:
void print()
{
cout<<"bad tooth"<<endl;
}
};
int main()
{
test* point= &obj;
(obj*)point->print();
}