System.DynamicArray.Copy

From RAD Studio API Documentation
Jump to: navigation, search

C++

DynamicArray<T>::Copy() const
DynamicArray<T>::Copy(DynamicArray<T>& dst) const

Properties

Type Visibility Source Unit Parent
function public sysdyn.h System DynamicArray

Description

Copies the contents of a DynamicArray to the specified DynamicArray.

Use Copy to make a copy of a dynamic array. Dynamic arrays are reference counted. Therefor, assigning one to another simply copies the reference, not the data. The Copy method, on the other hand, makes a separate copy of the dynamic array. The original contents of the destination array are discarded.

The following code copies the contents of i_array into temp; temp and i_array must be of the same DynamicArray type.

temp = i_array.Copy();

See Also