Using Array::Copy to copy array
#include "stdafx.h"
using namespace System;
int main()
{
array<int>^ array1 = { 0, 1, 2};
array<int>^ array2 = array1;
array<int>^ array3 = gcnew array<int>(3);
Array::Copy(array1, array3, array1->Length);
array3[0] = 200;
Console::WriteLine( "{0} {1} {2}", array1[0], array1[1], array1[2]);
}
Related examples in the same category