登录
首页 » c++ » 动态数组模板类的C++实现

动态数组模板类的C++实现

于 2022-01-28 发布 文件大小:1.47 kB
0 118
下载积分: 2 下载次数: 1

代码说明:

动态数组模板类的C++实现#ifndef ARRAY_CLASS#define ARRAY_CLASS#include #include using namespace std;#ifndef NULLconst int NULL = 0;#endif//错误类型集合, 共三种,数组大小错误,内存分配错误和下标越界enum ErrorType {invalidArraySize, memoryAllocationError, indexOutOfRange};//错误信息char *errorMsg[] = {"Invalid array size", "Memery allocation error", "Index out of range"};//数组类模板声明templateclass Array{    public:        Array(int sz = 50);        Array(const Array &A);        ~Array(void);        Array& operator = (const Array &rhs);     //重载=,使数组对象可以整体赋值        T& operator[](int n);            

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • ADS1298 TI MSP430例程
    ADS1298 TI MSP430例程,有需要的可以看看(ads1298 driver example, may be very useful)
    2016-01-04 16:24:14下载
    积分:1
  • autocorrelation
    时间序列中自相关函数的计算代码,内附程序说明(Time series in the calculation of the autocorrelation function of the code, containing a description of the procedures)
    2010-10-10 10:44:54下载
    积分:1
  • 二叉树表达代数表达式
    尽量不要转载,谢谢          编写一个程序,代数表达式通过键盘输入,用二叉树表示代数表达式,二叉树的每个结点包括一个运算符或操作数,代数表达式中只包含+、-、*、/和整数且没有错误,要求按照四则运算法则构造二叉树,然后由对应的二叉树计算对应的表达式的值。
    2022-01-23 10:05:21下载
    积分:1
  • coolbutton
    按钮的编写,用MFC实现,具体实现为XP风格按钮(XP style button)
    2009-04-12 18:39:31下载
    积分:1
  • Pegasis
    Pegasis protocol in matlab for routing analysis
    2017-07-26 19:22:11下载
    积分:1
  • 基于PID的汽车防抱死控制系统(ABS)的simulink模型
    基于PID控制器搭建的车辆防抱死控制系统(ABS)simulink模型。
    2019-05-12下载
    积分:1
  • 7
    说明:  7、反转姓名字符串,例如:输入James Levis输出Levis James 主程循环读入三个字符串,并分别输出其反转后的结果(7, reversed the names of the string, for example: James Levis input output Levis James read into the main three-way cycle of string, and output, respectively, after the results of their inversion)
    2007-09-29 15:26:25下载
    积分:1
  • TimeServer--mima
    从网络上获取标准时间,用以矫正本地主机的时间,使之与网络同步(From the network access standard time for the correction of the local host time so that with the network synchronization)
    2008-02-24 15:07:03下载
    积分:1
  • tuxiang
    自己写的一个C++程序,KMEANS的,希望大家看看(To write a C++ program, KMEANS, we hope to see)
    2015-04-15 20:45:32下载
    积分:1
  • AddMatrix
    用三元组表为结构,实现稀疏矩阵的加法并输出。(Achieve sparse matrix addition)
    2014-02-19 19:59:00下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载