1 / 5
文档名称:

2021年c中list的使用方法c#list使用方法.docx

格式:docx   大小:16KB   页数:5页
下载后只包含 1 个 DOCX 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

2021年c中list的使用方法c#list使用方法.docx

上传人:非学无以广才 2021/4/1 文件大小:16 KB

下载得到文件列表

2021年c中list的使用方法c#list使用方法.docx

相关文档

文档介绍

文档介绍:c中list的使用方法c#list使用方法

  c中list的使用方法
c中list的使用方法 下面xx就跟你们具体介绍下c中list的使用方法的使用方法,期望对你们有用。
  c中list的使用方法的使用方法以下:
  这几天在做图像处理方面的研究,其中有一部分是有关图像分割方面 的,图像目标在分割出来以后要做深入的处理,所以有必须将目标图像的信息 保留在一个变量里面,一开始想到的是数组,不过立即就发觉使用数组的缺点:
  数组长度固定,动态分配内存很轻易造成错误发生。最主要的一点是我要保留目 标图像的每一点的坐标值,使用数组就有点无能为力了。所以到baidu、Google 大神上面找思绪,最终被我发觉在c++的标准库里面还有这么一个模板类:list, 下面就是对找到的资料的汇总和加工。
  vc6自带的msdn帮助文档的解释 以下是引自msdn帮助文档:
  The template class describes an object that controls a varying-length sequence of elements of type T. The sequence is stored as a bidirectional linked list of elements, each containing a member of type T. 本模板类描述了一个对象,这个对象是类型为T的可变长度的序列元 素。这个序列采取双向链表的方法存放每一个元素,其中每一个元素的数据流行 全部是T。
  The object allocates and frees storage for the sequence it controls through a protected object named allocator, of class A. Such an allocator object must have the same external interface as an object of template class allocator. Note that allocatoris not copied when the object is assigned. 对序列对象的分配和释放操作经过一个受保护的对象allocator进行。
  这么一个allocator对象必需有相同的外部接口作为一个模板类分配器的对象。注 意:当对象被分配以后allocator不能被复制。
  List reallocation occurs when a member function must insert or erase elements of the controlled sequence. In all such cases, only iterators or references that point at erased portions of the controlled sequence become invalid. 当一个组员要进行insert或erase操作时,列表的重新分配操作发生。
  在这种情况下,只有迭代器或引用所指向的要删除的对象的指针变为无效。msdn帮助文档自带的例子 下面为m