Problem with copying arrays.
- by Machta
I have the following code:
string[] firstarray = { "bla bla", "bla bla", "bla bla"};
string[] secondArray = {"aaaaaaaaaaaa", "aaaaaaaaaaa", "aaaaaaaaa"};
string[] newArray = array;
array = secondArray;
foreach (string item in newArray)
{
Console.WriteLine(item);
}
This code gives the following results:
bla bla
bla bla
bla bla
I can't understand why the newArray has the same conntent after I assign a different instance to the array. Please help me.