Microsoft Foundation Classes (mfc.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
CObArray::Add
CObArray                                    Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  int Add( CObject* newElement )
  throw( CMemoryException );
 
  Parameter    Description
 
  <newElement> The CObject pointer to be added to this array.
 
  Remarks
 
  Adds a new element to the end of an array, growing the array by 1. 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.
 
  Return Value
 
  The index of the added element.
 
  Example
 
  CObArray array;
 
  array.Add( new CAge( 21 ) ); // Element 0
  array.Add( new CAge( 40 ) ); // Element 1
 
  The results from this program are as follows:
 
  Add example: A CObArray with 2 elements
      [0] = a CAge at $442A 21
      [1] = a CAge at $4468 40
 
  See Also
 
  CObArray::SetAt, CObArray::SetAtGrow, CObArray::InsertAt,
  CObArray::operator []
 
 
                                     -♦-