C++程序设计中构造函数的探讨  被引量:1

Discussion on Constructors in C++ Programming

在线阅读下载全文

作  者:李欣然[1] 靳雁霞[2] 

机构地区:[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[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象