首页 | 本学科首页   官方微博 | 高级检索  
     检索      

对C++类组合的理解及使用实例
引用本文:蔡朝晖.对C++类组合的理解及使用实例[J].高师理科学刊,2005,25(3):33-37.
作者姓名:蔡朝晖
作者单位:大庆师范学院,计算机系,黑龙江,大庆,163712
摘    要:在面向对象程序设计中解决较为复杂的问题需要用到类的组合.对C++组合类中构造函数的定义形式做了研究,分析了必须使用初始化列表来初始化组合类的数据成员的实质意义.使用组合类写了1个例题,并从算法上细化了此题,帮助理解及灵活应用组合类,另外在其构造函数设计思想上做了点新尝试.

关 键 词:组合类  构造函数  内嵌对象  初始化列表
文章编号:1007-9831(2005)03-0033-05
修稿时间:2005年4月2日

Comprehension to composition class in C++ and its applications
CAI Zhao-hui.Comprehension to composition class in C++ and its applications[J].Journal of Science of Teachers'College and University,2005,25(3):33-37.
Authors:CAI Zhao-hui
Abstract:One should use composition class while solving complicated problems in object programming.Studies the form of definitions to the constructor functions in the class of C++ composition class,analyzes the essential nature in using initialization list to initialize the data in composition class.Constructs an example and gives detailed algorithm to the example to help people in understanding and flexibly applying composition classes.Makes some efforts in designing the constructor functions.
Keywords:composition class  constructor function  inner embedding object  initialization list
本文献已被 CNKI 维普 万方数据 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号