1

EDIT: because it was marked as duplicate I searched a little further and found this link. So I made a Clone class and cloned each object separately and put it in my new array.

I have a 2 dimensional array of objects of which I would like to have a deep copy. So that when I use the original elements the copied don't change and vice versa.

Only answers I found consisted of 1 dimensional arrays or ints (which aren't self made objects).

A[,] Table = new A[5,5];
B[,] Copy = A; //this just contains references to A
icedwater
  • 4,701
  • 3
  • 35
  • 50
Jeroen L.
  • 11
  • 2

0 Answers0