检索规则说明:AND代表“并且”;OR代表“或者”;NOT代表“不包含”;(注意必须大写,运算符两边需空一格)
检 索 范 例 :范例一: (K=图书馆学 OR K=情报学) AND A=范并思 范例二:J=计算机应用与软件 AND (U=C++ OR U=Basic) NOT M=Visual
机构地区:[1]中北大学电子与计算机科学技术学院,山西太原030051 [2]中北大学仪器科学与动态测试教育部重点实验室
出 处:《计算机时代》2011年第12期30-32,共3页Computer Era
摘 要:首先介绍了类的构造函数特征和分类,举例说明了组合类对象和派生类对象构造函数的构造方法及调用次序;其次研究了使用缺省拷贝构造函数时,如果类中包含new运算符而导致指针挂起的原因,并给出了解决方法;最后介绍了转换构造函数的功能及使用转换构造函数进行类型转换的步骤。First we introduce the features and classification of class constructors, and illustrate the constructing methods and call order of combined class object and derived class object constructors, then give the solution to pointer hung caused by operator new in class while using default copy constructor, finally introduce the functions of conversion constructor and the procedure of type conversion by using conversion constructor
关 键 词:C++ 构造函数 派生类构造函数 拷贝构造函数 转换构造函数
分 类 号:TP311[自动化与计算机技术—计算机软件与理论]
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在链接到云南高校图书馆文献保障联盟下载...
云南高校图书馆联盟文献共享服务平台 版权所有©
您的IP:18.116.170.100