文件名称:1
-
所属分类:
- 标签属性:
- 上传时间:2013-05-17
-
文件大小:665byte
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
定义数组MyArray类。它满足的要求如下:1。该类用于保存整数;2。类可以检查数组下标溢出;3。客户端可以使用您定义为MyArray的主要代码:无效的main(){MyArray intarray(10);//这里10是intarray的元素的数目。对于(int i = 0;i < 10;i++)intarray [我] =我*我;//初始化intarray的元素cout << intarray;/ /打印中的每一个元素intarray}4。这是额外的需求:思考如何保存任何数据而不是整数。-Define array class: MyArray. It s satisfied with demands as follows:
1. The class is used to save integer
2. The class can check array subscr ipting overflow
3. The client can use MyArray you define like as following codes in the main:
void main()
{
MyArray intArray(10) // Here 10 is the number of intArray s elements.
for (int i=0 i<10 i++)
intArray[i] = i* i // Initialize the intArray s elements
cout << intArray // Print every element in the intArray
}
4. Here is additional demand: think over how to save any data rather than integer.
1. The class is used to save integer
2. The class can check array subscr ipting overflow
3. The client can use MyArray you define like as following codes in the main:
void main()
{
MyArray intArray(10) // Here 10 is the number of intArray s elements.
for (int i=0 i<10 i++)
intArray[i] = i* i // Initialize the intArray s elements
cout << intArray // Print every element in the intArray
}
4. Here is additional demand: think over how to save any data rather than integer.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
1.cpp
1999-2046 搜珍网 All Rights Reserved.
本站作为网络服务提供者,仅为网络服务对象提供信息存储空间,仅对用户上载内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。