Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
CArray::SetAt

CArray::SetAt

Sets the array element at the specified index.

void SetAt( 
   INT_PTR nIndex, 
   ARG_TYPE newElement  
);

nIndex

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

ARG_TYPE

Template parameter specifying the type of arguments used for referencing array elements.

newElement

The new element value to be stored at the specified position.

SetAt will not cause the array to grow. Use SetAtGrow if you want the array to grow automatically.

You must ensure that your index value represents a valid position in the array. If it is out of bounds, then the Debug version of the library asserts.

See the example for GetAt.

Header: afxtempl.h

Show:
© 2015 Microsoft