Hello,
I believed that structure is a reference type.
- public struct struct_A
- {
- public int struct_member1;
- public int struct_member2;
- public int struct_member3;
- }
- struct_A [] arrA_1 = new struct_A [7];
- struct_A [] arrA_2 = new struct_A [7];
- List
lst_A = new List (); - // list initialization
- for (int i = 0; i < arrA_1.Length; i++)
- {
- lst_A.Add(arrA_1[i];
- lst_A.Add(arrA_2[i];
- }
Then I assign arrA_1[0]. struct_member2:
- arrA_1[2].struct_member2 = 10;
- int check_value = lst_A[0].struct_member2
The check_value should be 10, but it isn't. Why ?
Thanks in advance.

PavelPosted Sep 29, 2016, 3:53 AM
Bikesh SrivastavaPosted Sep 28, 2016, 11:10 PM
Tapan PatelPosted Sep 28, 2016, 5:47 PM
Ehsan SajjadPosted Sep 28, 2016, 5:01 PM
PavelPosted Sep 28, 2016, 12:28 PM