- 0
- 0
- 约3.87万字
- 约 88页
- 2018-11-08 发布于天津
- 举报
(资料抽象化)培训教材.ppt
fig07_10.cppoutput (1 of 1) Date object constructor for date 7/24/1949 Date object constructor for date 3/12/1988 Employee object constructor: Bob Jones Jones, Bob Hired: 3/12/1988 Birth date: 7/24/1949 Test Date constructor with invalid values: Month 14 invalid. Set to month 1. Day 35 invalid. Set to day 1. Date object constructor for date 1/1/1994 Date object destructor for date 1/1/1994 Employee object destructor: Jones, Bob Date object destructor for date 3/12/1988 Date object destructor for date 7/24/1949 Date object destructor for date 3/12/1988 Date object destructor for date 7/24/1949 Note two additional Date objects constructed; no output since default copy constructor used. Destructor for host object manager runs before destructors for member objects hireDate and birthDate. Destructor for Employee’s member object hireDate. Destructor for Employee‘s member object birthDate. Destructor for Date object hire. Destructor for Date object birth. 7.4 friend Functions and friend Classes friend function (夥伴函數或友誼函數) Defined outside class’s scope Right to access non-public members Declaring friends Function Precede function prototype with keyword friend All member functions of class ClassTwo as friends of class ClassOne Place declaration of form friend class ClassTwo; in ClassOne definition 7.4 friend Functions and friend Classes Properties of friendship Friendship granted, not taken (是授予,不是取得) Class B friend of class A Class A must explicitly declare class B friend Not symmetric (無對稱性) Class B friend of class A Class A not necessarily friend of class B Not transitive (無轉移性) Class A friend of class B Class B friend of class C Class A not necessarily friend of Class C fig07_11.cpp(1 of 3) 1 // Fig. 7.11: fig07_11.cpp 2 // Friends can access private members of a class. 3 #include iostream 4 5 using std::cout; 6 using std::endl; 7 8 // Count class definition 9 class Count { 10 friend void
您可能关注的文档
- (人美版)二年级美术下册课件纸盒变家具1复习课程.ppt
- (人美版)五年级美术上册课件绘画中的透视现象1复习课程.ppt
- (人美版)五年级美术上册课件色彩的色相1.复习课程.ppt
- (人美版)六年级美术上册课件笔的世界2复习课程.ppt
- (企业管理)-五矿发展研究报告.ppt
- (修改后2)小学五年级英语下册 Unit2 My favourite seas知识分享.ppt
- (免费课件)腔肠、软体、甲壳、鱼图片集知识分享.ppt
- (全)联想集团战略咨询项目建议书研究报告.ppt
- (公共产品)-THE ROLE OF THE GOVERNMENT IN ECONOMY培训教材.ppt
- (公开课)四年级数学上册数学广角合理安排时间烙饼问知识分享.ppt
- 2025年全国演出经纪人员资格认定考试试卷带答案(研优卷).docx
- 2025年全国演出经纪人员资格认定考试试卷完整版.docx
- 2025年全国演出经纪人员资格认定考试试题库及完整答案.docx
- 2025年全国演出经纪人员资格认定考试试卷完美版.docx
- 2025年全国演出经纪人员资格认定考试试卷含答案(实用).docx
- 2025年全国演出经纪人员资格认定考试试卷及答案(各地真题).docx
- 2025年下半年内江市部分事业单位公开考试招聘工作人员(240人)备考题库附答案.docx
- 2025年全国演出经纪人员资格认定考试试卷及答案1套.docx
- 2025年下半年四川成都市郫都区面向社会引进公共类事业单位人员2人备考题库最新.docx
- 2025年下半年内江市部分事业单位公开考试招聘工作人员(240人)备考题库附答案.docx
最近下载
- 中小学教育教学常规讲座.pptx VIP
- 2025年渤海船舶职业学院单招数学考试模拟试题及答案解析.docx VIP
- 2024年渤海船舶职业学院单招数学考试试题及答案解析.docx VIP
- 2025年项目管理专业计划价值与项目报告编制专题试卷及解析.pdf VIP
- 2025年演出经纪人脑机接口技术在演出体验中的未来展望专题试卷及解析.pdf VIP
- 2025年碳排放管理师碳期权做市商的定价与风险管理专题试卷及解析.pdf VIP
- 2025年特许金融分析师抵押贷款支持证券的综合案例分析专题试卷及解析.pdf VIP
- 2025年金融风险管理师内部评级法下信用风险缓释的资本计算专题试卷及解析.pdf VIP
- 2025年AWS认证AmazonRDS只读副本的只读副本的跨区域数据传输安全专题试卷及解析.pdf VIP
- ZCC5000-1履带式起重机技术规格书.pdf VIP
原创力文档

文档评论(0)