CObArray::Append

int Append( const CObArray& src );

Return Value

The index of the first appended element.

Parameters

src

Source of the elements to be appended to the array.

Remarks

Call this member function to add the contents of another array to the end of the given array. The arrays must be of the same type.

If necessary, Append may allocate extra memory to accommodate the elements appended to the array.

The following table shows other member functions that are similar to CObArray::Append.

Class Member Function
CByteArray int Append( const CByteArray& src);
CDWordArray int Append( const CDWordArray& src );
CPtrArray int Append( const CPtrArray& src );
CStringArray int Append( const CStringArray& src );
CUIntArray int Append( const CUIntArray& src );
CWordArray int Append( const CWordArray& src );

Example

See CObList::CObList for a listing of the CAge class used in all collection examples.

CObArray myArray1, myArray2;

   // Add elements to the second array.
   myArray2.Add( new CAge( 21 ) );
   myArray2.Add( new CAge( 42 ) );

   // Add elements to the first array and also append the second array.
   myArray1.Add( new CAge( 3 ) );
   myArray1.Append( myArray2 );

#ifdef _DEBUG
    afxDump.SetDepth( 1 );
    afxDump << "myArray1: " << &myArray1 << "\n";
    afxDump << "myArray2: " << &myArray2 << "\n";
#endif

CObArray OverviewClass MembersHierarchy Chart

See Also   CObArray::Copy