c++類(lèi)的定義 定義一個(gè)人員類(lèi)Cpeople?
定義一個(gè)人員類(lèi)Cpeople?Class cpeople:public cstudent;t{TCHAR[20]name;TCHAR sex;tint age;t};Class cpeople:pub
定義一個(gè)人員類(lèi)Cpeople?
Class cpeople:public cstudent;t{TCHAR[20]name;TCHAR sex;tint age;t};Class cpeople:public cstudent;t{tint num;tcstring enterscholtime;tfload score;可以設(shè)置7門(mén)課的成績(jī);可以派生出上述其他類(lèi),只需添加相應(yīng)屬性即可
1)先調(diào)用父類(lèi)構(gòu)造方法,并輸出1{tppublic people(){t} 系統(tǒng)輸出打印(1) }2) 公共子級(jí)(字符串名稱(chēng)){ 系統(tǒng)輸出打印(3) //輸出3 此名稱(chēng)=Name