Partager via


CArray::Copy

Use this member function to copy the elements of one array to another.

void Copy(
   const CArray& src 
);

Parameters

  • src
    Source of the elements to be copied to an array.

Remarks

Call this member function to overwrite the elements of one array with the elements of another array.

Copy does not free memory; however, if necessary, Copy may allocate extra memory to accommodate the elements copied to the array.

Example

CArray<CPoint,CPoint> myArray1, myArray2;

// Add elements to the second array.
myArray2.Add(CPoint(11, 22));
myArray2.Add(CPoint(12, 42));

// Copy the elements from the second array to the first.
myArray1.Copy(myArray2);

Requirements

Header: afxtempl.h

See Also

Reference

CArray Class

Hierarchy Chart

CArray::Append

Other Resources

CArray Members