Call this member function to overwrite the elements of the given array with the elements of another array of the same type.
Copy does not free memory; however, if necessary, Copy may allocate extra memory to accommodate the elements copied to the array.
The following table shows other member functions that are similar to CObArray::Copy.
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)); // Copy the elements from the second array to the first. myArray1.Copy(myArray2); #ifdef _DEBUG afxDump.SetDepth(1); afxDump << "myArray1: " << &myArray1 << "\n"; afxDump << "myArray2: " << &myArray2 << "\n"; #endif