// 虛析構函數(shù)
virtual ~Animal(){cout << "~Animal" << endl;}
// 虛成員函數(shù)
void eat(){cout << "Animal--" << m_strName << "-- eat" << endl;}
// 純虛函數(shù)
virtual void move() {cout<<"move()"<<endl;}
public:
// 數(shù)據(jù)成員
string m_strName;
};
virtual ~Animal(){cout << "~Animal" << endl;}
// 虛成員函數(shù)
void eat(){cout << "Animal--" << m_strName << "-- eat" << endl;}
// 純虛函數(shù)
virtual void move() {cout<<"move()"<<endl;}
public:
// 數(shù)據(jù)成員
string m_strName;
};