[求助]vc++中不能继承
#include<iostream.h>
class Animal
{
public:
void eat()
{
cout<<"animal eat"<<endl;
}
void sleep()
{
cout<<"animal sleep"<<endl;
}
void breathe()
{
cout<<"animal breathe"<<endl;
}
};
class Fish: public Animal
{
};
void main()
{
Animal an;
an.eat();
Fish fh;
fh.sleep;
}
为什么运行的结果只有animal eat,Fish没办法继承