RemoveAt
It removes the object at the supplied index from the array. If owner, the object will be destroyed.
BOOL RemoveAt( int nIndex )
Returns a boolean indicating success or failure of the requested operation
EX1
#include <Array.h> struct PERSON { int nID; }; void Array_RemoveAt_ex1() { Array<PERSON&> arp(true); //is owner for ( int ii = 0; ii < 4; ii++ ) { PERSON* tp = new PERSON; tp->nID = ii + 1; arp.Add(*tp); } if ( arp.RemoveAt(0) ) //remove the first item { for ( ii = 0; ii < arp.GetSize(); ii++ ) { //the item with nID value as 1 is removed and can not be printed now. printf("PERSON %d's ID is : %d\n", ii + 1, arp.GetAt(ii).nID); } } }
Array.h