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

CArray::Add

Adds a new element to the end of an array, growing the array by 1.

INT_PTR Add( 
   ARG_TYPE newElement  
);
ARG_TYPE

Template parameter specifying the type of arguments referencing elements in this array.

newElement

The element to be added to this array.

The index of the added element.

If SetSize has been used with an nGrowBy value greater than 1, then extra memory may be allocated. However, the upper bound will increase by only 1.

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

CPoint pt(10,20);
ptArray.Add(pt);             // Element 0
ptArray.Add(CPoint(30,40));  // Element 1

Header: afxtempl.h

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