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