文件名称:MyArray
介绍说明--下载内容均来自于网络,请自行研究使用
动态数组及模板类
任务目标:
学习C++的类机制、模板机制、运算符重载、重载函数机制、内存动态分配与释放等。
任务描述:
使用C++的类机制实现一个动态的数组类MyArray,具有完整的构造和析构函数。使用模板机制,使其能够支持各种数据类型(包括结构体)。MyArray类中实现以下方法:
添加一个元素,使用函数重载的方式,实现1)添加数组尾部,2)添加到指定序号位置;
通过函数,设置指定位置(序号)的元素数据;
删除指定序号的元素;
删除所有元素;
获得元素个数
通过函数获取指定序号的元素;
重载运算符‘[]’,可以通过序号引用数组元素。
实现以上功能的动态数组类,并设计测试代码,验证实现的所有功能。要求数组元素的数据类型为自定义的数据结构,如“学生信息”。
任务提示:
添加元素时用new分配空间,删除时用delete删除空间-Dynamic arrays and template class mission objectives: learning class mechanism C++, the template mechanism, operator overloading, function overloading mechanism, such as dynamic memory allocation and deallocation. Task Descr iption: Use C++ class mechanism to implement a dynamic array class MyArray, with full constructor and destructor functions. Using the template mechanism to support a variety of data types (including structures). MyArray class implements the following methods: add an element, the use of function overloading way to achieve a) to add an array of tail, 2) to specify the ordinal position through the function, setting the specified location (number) of the element data delete the specified number of Elements delete all the elements obtain the number of elements specified number of elements to get through the function overloaded operator ' []' , array elements can be referenced by number. Achieve more dynamic array class functionality and design test code, verif
任务目标:
学习C++的类机制、模板机制、运算符重载、重载函数机制、内存动态分配与释放等。
任务描述:
使用C++的类机制实现一个动态的数组类MyArray,具有完整的构造和析构函数。使用模板机制,使其能够支持各种数据类型(包括结构体)。MyArray类中实现以下方法:
添加一个元素,使用函数重载的方式,实现1)添加数组尾部,2)添加到指定序号位置;
通过函数,设置指定位置(序号)的元素数据;
删除指定序号的元素;
删除所有元素;
获得元素个数
通过函数获取指定序号的元素;
重载运算符‘[]’,可以通过序号引用数组元素。
实现以上功能的动态数组类,并设计测试代码,验证实现的所有功能。要求数组元素的数据类型为自定义的数据结构,如“学生信息”。
任务提示:
添加元素时用new分配空间,删除时用delete删除空间-Dynamic arrays and template class mission objectives: learning class mechanism C++, the template mechanism, operator overloading, function overloading mechanism, such as dynamic memory allocation and deallocation. Task Descr iption: Use C++ class mechanism to implement a dynamic array class MyArray, with full constructor and destructor functions. Using the template mechanism to support a variety of data types (including structures). MyArray class implements the following methods: add an element, the use of function overloading way to achieve a) to add an array of tail, 2) to specify the ordinal position through the function, setting the specified location (number) of the element data delete the specified number of Elements delete all the elements obtain the number of elements specified number of elements to get through the function overloaded operator ' []' , array elements can be referenced by number. Achieve more dynamic array class functionality and design test code, verif
(系统自动生成,下载前可以参看下载内容)
下载文件列表
MyArray
.......\Debug
.......\.....\MyArray.exe
.......\.....\MyArray.ilk
.......\.....\MyArray.pdb
.......\ipch
.......\....\myarray-a48f0e70
.......\....\................\myarray-86c48431.ipch
.......\MyArray
.......\MyArray.sdf
.......\MyArray.sln
.......\MyArray.suo
.......\.......\Debug
.......\.......\.....\CL.read.1.tlog
.......\.......\.....\CL.write.1.tlog
.......\.......\.....\link-cvtres.read.1.tlog
.......\.......\.....\link-cvtres.write.1.tlog
.......\.......\.....\link.12744-cvtres.read.1.tlog
.......\.......\.....\link.12744-cvtres.write.1.tlog
.......\.......\.....\link.12744.read.1.tlog
.......\.......\.....\link.12744.write.1.tlog
.......\.......\.....\link.15624-cvtres.read.1.tlog
.......\.......\.....\link.15624-cvtres.write.1.tlog
.......\.......\.....\link.15624.read.1.tlog
.......\.......\.....\link.15624.write.1.tlog
.......\.......\.....\link.3024-cvtres.read.1.tlog
.......\.......\.....\link.3024-cvtres.write.1.tlog
.......\.......\.....\link.3024.read.1.tlog
.......\.......\.....\link.3024.write.1.tlog
.......\.......\.....\link.read.1.tlog
.......\.......\.....\link.write.1.tlog
.......\.......\.....\main.obj
.......\.......\.....\mt.read.1.tlog
.......\.......\.....\mt.write.1.tlog
.......\.......\.....\MyArray.exe
.......\.......\.....\MyArray.exe.embed.manifest
.......\.......\.....\MyArray.exe.embed.manifest.res
.......\.......\.....\MyArray.exe.intermediate.manifest
.......\.......\.....\MyArray.ilk
.......\.......\.....\MyArray.lastbuildstate
.......\.......\.....\MyArray.log
.......\.......\.....\MyArray.pdb
.......\.......\.....\MyArray.vcxprojResolveAssemblyReference.cache
.......\.......\.....\MyArray.write.1.tlog
.......\.......\.....\MyArray_manifest.rc
.......\.......\.....\rc.read.1.tlog
.......\.......\.....\rc.write.1.tlog
.......\.......\.....\vc100.idb
.......\.......\.....\vc100.pdb
.......\.......\ipch
.......\.......\....\myarray-2da9a39c
.......\.......\....\................\myarray-86c48431.ipch
.......\.......\main.cpp
.......\.......\MyArray
.......\.......\MyArray.h
.......\.......\MyArray.sdf
.......\.......\MyArray.sln
.......\.......\MyArray.suo
.......\.......\MyArray.vcxproj
.......\.......\MyArray.vcxproj.filters
.......\.......\MyArray.vcxproj.user
.......\.......\.......\Debug
.......\.......\.......\.....\CL.read.1.tlog
.......\.......\.......\.....\CL.write.1.tlog
.......\.......\.......\.....\link-cvtres.read.1.tlog
.......\.......\.......\.....\link-cvtres.write.1.tlog
.......\.......\.......\.....\link.12744-cvtres.read.1.tlog
.......\.......\.......\.....\link.12744-cvtres.write.1.tlog
.......\.......\.......\.....\link.12744.read.1.tlog
.......\.......\.......\.....\link.12744.write.1.tlog
.......\.......\.......\.....\link.15624-cvtres.read.1.tlog
.......\.......\.......\.....\link.15624-cvtres.write.1.tlog
.......\.......\.......\.....\link.15624.read.1.tlog
.......\.......\.......\.....\link.15624.write.1.tlog
.......\.......\.......\.....\link.3024-cvtres.read.1.tlog
.......\.......\.......\.....\link.3024-cvtres.write.1.tlog
.......\.......\.......\.....\link.3024.read.1.tlog
.......\.......\.......\.....\link.3024.write.1.tlog
.......\.......\.......\.....\link.read.1.tlog
.......\.......\.......\.....\link.write.1.tlog
.......\.......\.......\.....\main.obj
.......\.......\.......\.....\mt.read.1.tlog
.......\.......\.......\.....\mt.write.1.tlog
.......\.......\.......\.....\MyArray.exe.embed.manifest
.......\.......\.......\.....\MyArray.exe.embed.manifest.res
.......\.......\.......\.....\MyArray.exe.intermediate.manifest
.......\.......\.......\.....\MyArray.lastbuildstate
.......\.......\.......\.....\MyArray.log
.......\.......\.......\.....\MyArray.vcxprojResolveAssemblyReference.cache
.......\.......\.......\.....\MyArray.write.1.tlog
.......\.......\.......\.....\MyArray_manifest.rc
.......\.......\.......\.....\rc.read.1.tlog
.......\.......\.......\.....\rc.write.1.tlog
.......\.......\.......\.....\vc100.idb
.......\.......\.......\.....\vc100.pdb
.......\.......\.......\main.cpp
.......\.......\.......\MyArray.h
.......\.......\.