Hello, I’m having a bit of trouble with lists, mainly I want to copy contents of one list to another one without leaving any connection between them. But for some reason I’m not able to do that, I’ve noticed that this happens only with lists of lists. Thanks for any help
List<int> A = new List<int> ();
List < List<int>>B= new List < List<int>>();
List < List<int>>D= new List < List<int>>();
void Start () {
A.Add (3);
A.Add (4);
A.Add (5);
B.Add (new List<int> (A));
D = new List<List<int>> (B); //why new doesn't mean new?
B [0] [1] = 7;
print (D [0] [1]); //prints 7 and I want 4
}
}