#include<iostream.h>
class Animal
{
void Eat()
{
cout<<"Animal eat"<<endl;
}
};
class Fish:public Animal
{
void Eat()
{
cout<<"Fish eat"<<endl;
}
};
int main()
{
Fish fish;
Animal * an;
an=&fish;
an->AnimalEat;
return 0;
#include<iostream.h>
class Animal
{
void Eat()
{
cout<<"Animal eat"<<endl;
}
};
class Fish:public Animal
{
void Eat()
{
cout<<"Fish eat"<<endl;
}
};
int main()
{
Fish fish;
Animal * an;
an=&fish;
an->AnimalEat;
return 0;