#include <iostream.h>
class Animal
{
public :
Animal(int heigth)
{
}
~Animal()
{
}
void eat()
{
cout<<"Animal eat"<<endl;
}
void sleep()
{
cout<<"Animal sleep"<<endl;
}
virtual void breathe()
{
cout<<"animal breathe"<<endl;
}
};
class Fish : public Animal
{
public :
Fish():Animal(300),a(100)
{
}
~Fish()
{
}
void breathe()
{
cout<<"fish breathe"<<endl;
}
const int a;
};
void fn(Animal *pAn)
{
pAn->breathe();
}
void main()
{
Fish fh;
Animal *pAn;
pAn=&fh;
fn(pAn);
int a=6;
int &b=a;
cout<<b<<endl;
}