检索规则说明:AND代表“并且”;OR代表“或者”;NOT代表“不包含”;(注意必须大写,运算符两边需空一格)
检 索 范 例 :范例一: (K=图书馆学 OR K=情报学) AND A=范并思 范例二:J=计算机应用与软件 AND (U=C++ OR U=Basic) NOT M=Visual
机构地区:[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[自动化与计算机技术—计算机软件与理论]
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在链接到云南高校图书馆文献保障联盟下载...
云南高校图书馆联盟文献共享服务平台 版权所有©
您的IP:216.73.216.62