Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic


Removes one or more elements starting at a specified index in an array.

void RemoveAt( 
   INT_PTR nIndex, 
   INT_PTR nCount = 1  

An integer index that is greater than or equal to 0 and less than or equal to the value returned by GetUpperBound.


The number of elements to remove.

In the process, it shifts down all the elements above the removed element(s). It decrements the upper bound of the array but does not free memory.

If you try to remove more elements than are contained in the array above the removal point, then the Debug version of the library asserts.

CArray<CPoint,CPoint> myArray;

// Add elements to the array. 
for (int i = 0; i < 10; i++)
   myArray.Add(CPoint(i, 2*i));


#ifdef _DEBUG
   afxDump << "myArray: " << &myArray << "\n";

Header: afxtempl.h

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.