#include #include #include //setw:設定輸出資料的寬度,使用時應#include using namespace std;
class cperson
;class cemployee:public cperson
;cperson::cperson(char *name,char *id,int ***,int age):m_n***(***),m_nage(age)
cperson::~cperson()
void cperson::show1()
在釋放建立物件時動態分配的記憶體這塊不太上手
![](https://pic.w3help.cc/106/da4374fe6be7621261df162d8d2ae.jpeg)
第十周 任務二
include include include setw 設定輸出資料的寬度,使用時應 include using namespace std class cperson class cemployee public cperson cemployee cemployee char name,cha...
第十周任務二
任務2 定義乙個名為cperson的類,有以下私有成員 姓名 身份證號 性別和年齡,成員函式 建構函式 析構函式 輸出資訊的函式。並在此基礎上派生出cemployee類,派生類cemployee增加了兩個新的資料成員,分別用於表示部門和薪水。要求派生類cemployee的建構函式顯示呼叫基類cper...
第十周 任務二 2 1
檔名稱 派生類的應用。作 者 張啟立 完成日期 2012年 4 月 16 日 版 本 號 10 2 1 include include include setw 設定輸出資料的寬度,使用時應 include using namespace std class cperson 基類函式定義 cpers...