freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

清華c語言程序設(shè)計:第15章多態(tài)性-資料下載頁

2025-10-07 13:35本頁面
  

【正文】 nd!endl。 } private: int age。 }。 例子 3:虛析構(gòu)函數(shù)的例子 //文件 include include const int MAX = 100。 main() { int no。 //聲明儲存雇員信息的數(shù)組 Employee *ptr[MAX], *tptr。 int ENum = 0。 char name[100]。 int age。 for (int i=0。 iMAX。 i++) { ptr[i] = NULL。 } 例子 3:虛析構(gòu)函數(shù)的例子 //輸入雇員信息 coutInput employees39。 info:endl。 cout1 Programmerendl 2 Accountantendl 0 exitendl。 cinno。 while (no) { switch (no) { case 1: //輸入程序員信息 coutPlease input his or her name:。 cinname。 //創(chuàng)建程序員對象 tptr = new Programmer(name)。 ptr[ENum++] = tptr。 break。 例子 3:虛析構(gòu)函數(shù)的例子 case 2: //輸入會計信息 coutPlease input his or her age:。 cinage。 //創(chuàng)建會計對象 tptr = new Accountant(age)。 ptr[ENum++] = tptr。 break。 default: break。 } coutInput another employee39。s info:endl。 cout1 Programmerendl2 Accountant endl0 exitendl。 cinno。 } 例子 3:虛析構(gòu)函數(shù)的例子 //撤銷所有雇員對象 for (i=0。 iENum。 i++) { delete ptr[i]。 } return 0。 } 學(xué)習(xí)目的檢測 ? 理解靜態(tài)綁定和動態(tài)綁定的概念 ? 了解多態(tài)性的意義和作用 ? 掌握定義虛函數(shù)和抽象基類的方法 ? 掌握實現(xiàn)多態(tài)性的方法以及使用多態(tài)性的時機 ? 了解虛析構(gòu)函數(shù)的作用 ? 掌握如何使用多態(tài)性進行軟件的漸增式開發(fā) 作業(yè)
點擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1