虛函數(shù)與純虛函數(shù)請參考:http://blog.csdn.net/hackbuteer1/article/details/7558868
創(chuàng)新互聯(lián)主營友誼網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營網(wǎng)站建設(shè)方案,App定制開發(fā),友誼h5小程序設(shè)計搭建,友誼網(wǎng)站營銷推廣歡迎友誼等地區(qū)企業(yè)咨詢
#includeusing namespace std; class Animal { public: virtual void eat()=0; virtual void sleep()=0; }; class Cat:public Animal { public: void eat() { cout<<"The cat is eating now."< eat(); p->sleep(); cout<<"========================"<
網(wǎng)站名稱:C++抽象類與純虛函數(shù)實戰(zhàn)舉例
文章起源:http://weahome.cn/article/gocihh.html