The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.



Call this method to insert a new element (or multiple copies of an element) into the array object.

      void InsertAt(
   size_t iElement,
   INARGTYPE element,
   size_t nCount = 1 


The index where the element or elements are to be inserted.


The value of the element or elements to be inserted.


The number of elements to add.

Inserts one or more elements into the array, starting at index iElement. Existing elements are moved to avoid being overwritten.

In debug builds, an ATLASSERT will be raised if the CAtlArray object is invalid, the number of elements to be added is zero, or the combined number of elements is too large for the array to contain. In retail builds, passing invalid parameters may cause unpredictable results.


// Declare an array of integers
CAtlArray<int> iBuffer;

// Add elements to the array
for (int b = 0; b < 10; b++)

// Instert ten 1's into the array
// at position 5
iBuffer.InsertAt(5, 1, 10);   


Header: atlcoll.h