繼承的作用以及在子類中初始化所有數據的方法

1.方便擴充程序,使之不必重寫整個程序 代碼示例 1 #include <iostream> 2 #include <string> 3 using namespace std; 4 class father 5 { 6 protected: 7 string name; 8 int tall; 9 public: 10 father(string a,
相關文章
相關標籤/搜索