繼承,多重繼承與虛繼承

1.繼承其實就是在一個類的基礎上擴展新的功能的類型。 #include <iostream> using namespace std; class Animal { private: int age; public: void eat() { age = 88; cout <<"animal eat" << endl; }; }; // Animal叫作Human的父類, Human是Animal
相關文章
相關標籤/搜索