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

C++动态数组的实现与重用
引用本文:陈凤祥,李汪根.C++动态数组的实现与重用[J].微机发展,2010(2):79-82,86.
作者姓名:陈凤祥  李汪根
作者单位:安徽师范大学数学计算机科学学院;
基金项目:安徽省自然科学基金(070412043)
摘    要:数组是应用程序中经常要用到的一种数据结构。为解决C++定义后的数组不能改变其大小的情况,根据软件重用的思想,给出了用函数模板、动态数组类和数组类模板生成C++动态数组的方法,并对这些方法在代码重用方面进行了比较。文中主要给出了动态生成二维数组的函数模板、动态数组类和数组类模板的定义,以及部分成员函数和运算符重载函数的实现代码或算法。以动态生成二维整型数组,进行矩阵的加法运算为例,给出了使用方法。应用文中所给的方法,能满足应用程序中动态定义一维和二维数组的需要。

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

The Implementation and Reuse of C++ Dynamic Arrays
CHEN Feng-xiang,LI Wang-gen.The Implementation and Reuse of C++ Dynamic Arrays[J].Microcomputer Development,2010(2):79-82,86.
Authors:CHEN Feng-xiang  LI Wang-gen
Affiliation:CHEN Feng-xiang,LI Wang-gen(School of Mathematics , Computer Science,Anhui Normal University,Wuhu 241000,China)
Abstract: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...
Keywords:software reuse  dynamic array  function templates  array class  array templates  
本文献已被 CNKI 维普 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

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