C++动态数组的实现与重用  被引量:9

The Implementation and Reuse of C++ Dynamic Arrays

在线阅读下载全文

作  者:陈凤祥[1] 李汪根[1] 

机构地区:[1]安徽师范大学数学计算机科学学院,安徽芜湖241000

出  处:《计算机技术与发展》2010年第2期79-82,86,共5页Computer Technology and Development

基  金:安徽省自然科学基金(070412043)

摘  要:数组是应用程序中经常要用到的一种数据结构。为解决C++定义后的数组不能改变其大小的情况,根据软件重用的思想,给出了用函数模板、动态数组类和数组类模板生成C++动态数组的方法,并对这些方法在代码重用方面进行了比较。文中主要给出了动态生成二维数组的函数模板、动态数组类和数组类模板的定义,以及部分成员函数和运算符重载函数的实现代码或算法。以动态生成二维整型数组,进行矩阵的加法运算为例,给出了使用方法。应用文中所给的方法,能满足应用程序中动态定义一维和二维数组的需要。Arrays are important data structures used to proggramming,the C++ array size is fixed after declaring. According to the idea of software reuse, these methods to generate C ++ dynamic array were put forward and these methods based on function templates, array classes and array templates, meanwhile these methods were compared in code reuse. These definitions of function templates, array classes and array templates were proposed, also some code of member functions and operator overloading were implemented. Further more addition was implemented between matrixs,so dynamic array was come true to make use of these methods.

关 键 词:软件重用 动态数组 函数模板 数组类 数组类模板 

分 类 号:TP311[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

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