移除开始在数组中指定的索引的一个或多个元素。
void RemoveAt(
INT_PTR nIndex,
INT_PTR nCount = 1
);
参数
nIndex
大于或等于0并且小于或等于 GetUpperBound返回的值的整数索引。nCount
要移除的元素数。
备注
在处理,则转换在移除的元素上的所有元素下。它通过递减数组的上限,但不释放内存。
如果不在该删除上的尝试移除多个元素数组包含该点,则库的调试版本断言。
示例
CArray<CPoint,CPoint> myArray;
// Add elements to the array.
for (int i = 0; i < 10; i++)
myArray.Add(CPoint(i, 2*i));
myArray.RemoveAt(5);
#ifdef _DEBUG
afxDump.SetDepth(1);
afxDump << "myArray: " << &myArray << "\n";
#endif
要求
Header: afxtempl.h