TYPE& operator[]( INT_PTR nIndex ); const TYPE& operator[]( INT_PTR nIndex ) const; 参数 类型 指定元素的类型模板参数中的数组。 nIndex 将捕获的元素的索引。 备注 第一个运算符,调用对于不是const的数组,在正确(r值)或左侧(左值)可以使用赋值语句。第二,调用为const数组,则右边只能使用。
CArray::SetAtGrow 设置给定索引的值;根据需要扩展该数组。 CArray::SetSize 设置要在该数组中包含的元素数。公共运算符“属性”说明 operator[] 设置或获取位于指定索引处的元素。注解数组索引的起始位置始终为 0。 可以决定是修复上限,还是将数组设置为在添加超过当前上限的元素时进行扩展。 即使某些元素为 null,...
void InsertAt( int nStartIndex, CArray* pNewArray ); throw( CMemoryException ); 插入一个元素(或另一个数组)到数组. CArray::RemoveAt void RemoveAt( int nIndex, int nCount = 1 ); 删除另一个元素. CArray::operator [ ] TYPE& operator []( int nIndex ); TYPE operator []( int nI...
请参阅 CArray::GetUpperBound,CArray::GetSize 操作符 CArray::opertor[] TYPE& operator[](int nIndex); TYPE& operator[](int nIndex) const; 参数 TYPE指定此数组中元素的类型的模板参数。 nIndex被访问的元素的索引。 说明 这些下标运算符可方便地取代SetAt和GetAt函数。第一个运算符,不是常量的数组调...
operator [] 在特定索引上设置或获取元素 1. 新键一个基于对话框的应用程序,命名为CArrayTest,在 CarrayTestDlg.h文件在添加CArray的头文件#include <afxtempl.h> 2. 为对话框新增一个成员变量: CArray<CPoint,CPoint&>m_PoinyArray;//保存CPoint类型的数组 ...
array 数组 declaration 声明 represent 表示 manipulate 处理 结构体、共用体、链表: structure 结构 member 成员 tag 标记 function 函数 enumerate 枚举 union 联合(共用体) create 创建 insert 插入 delete 删除 modify 修改文件: 1、file 文件 2、open 打开 3、close 关闭 4、read 读 5、write 写 6、error ...
Provides array-like syntax for accessing a row in the rowset. Copy TAccessor& operator[]( int nRow ); Parameters TAccessor A templated parameter that specifies the type of accessor stored in the rowset. nRow [in] Number of the row (array element) you want to access. Return Value ...
If the items in the CArray are not compatible with memcpy_s, you must create a new CArray of the appropriate size. You must then use CArray::Copy and CArray::SetAt to populate the new array because those methods use an assignment operator instead of memcpy_s. As with a C array, ...
If it is out of bounds, then the Debug version of the library asserts. Example See the example for GetAt. Requirements Header: afxtempl.h See Also Concepts CArray Class CArray Members Hierarchy Chart CArray::GetAt CArray::SetAtGrow CArray::ElementAt CArray::operator []...
CArray详解 CArchive没有基类。 CArchive允许以一个永久二进制(通常为磁盘存储)的形式保存一个对象的复杂网络,它可以在对象被删除时,还能永久保存。可以从永久存储中装载对象,在内存中重新构造它们。使得数据永久保留的过程就叫作“串行化”。 可以把一个归档对象看作一种二进制流。象输入/输出流一样,归档与文件有...