CArray::SetAtGrow

void SetAtGrow( int nIndex, ARG_TYPE newElement );
throw( CMemoryException );

Parameters

nIndex

An integer index that is greater than or equal to 0.

ARG_TYPE

Template parameter specifying the type of elements in the array.

newElement

The element to be added to this array. A NULL value is allowed.

Remarks

Sets the array element at the specified index. The array grows automatically if necessary (that is, the upper bound is adjusted to accommodate the new element).

Example

// example for CArray::SetAtGrow
CArray<CPoint,CPoint> ptArray;

ptArray.Add(CPoint(10,20));   // Element 0
ptArray.Add(CPoint(30,40));   // Element 1
                     // Element 2 deliberately skipped
ptArray.SetAtGrow(3, CPoint(50,60));   // Element 3

CArray OverviewClass MembersHierarchy Chart

See Also   CArray::GetAt, CArray::SetAt, CArray::ElementAt, CArray::operator []