C++面向对象程序设计第七章(18)

2021-02-21 10:47

C++面向对象程序设计

46 47 48 49 50 51 52

53 54 55 56 57 58 59 60 61 basederived// aim base-class pointer at derived-class object and print commissionEmployeePtr commissionEmployeePtr = &basePlusCommissionEmployee; basecout << "\n\n\nCalling print with base-class pointer to " "derivedobject\ base<< "derived-class object\ninvokes base-class print " derivedobject:\ n"; << "function on that derived-class object:\n\n"; commissionEmployeePtrbasecommissionEmployeePtr->print(); // invokes base-class print yeePtr cout << endl; return 0; derivedderived// aim derived-class pointer at derived-class object and print basePlusCommissionEmployeePtr = &basePlusCommissionEmployee; // natural derivedcout << "\n\n\nCalling print with derived-class pointer to " "\nderived edderived<< "\nderived-class object invokes derived-class " function:\ n"; << "print function:\n\n"; basePlusCommissionEmployeePtrderivedbasePlusCommissionEmployeePtr->print(); // invokes derived-class print

Outline

fig13_05.cpp

(3 of 5)

62 } // end main


C++面向对象程序设计第七章(18).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:医疗废物管理委员会组成、职责及会议制度

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: