What?s the difference between the System.Array.CopyTo() and
System.Array.Clone()?
Answer Posted / sree..
The below code does a deep copy.
Let me know if something is wrong with the code.
string[] array = new string[1] { "aaa" };
string[] copy = new string[1];
array.CopyTo(copy, 0);
copy[0] = "xyz";
Console.WriteLine(array[0]);
I see array[0] value as "aaa".
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
Difference between value and reference type.
What is difference between ienumerable and enumerable in c#?
What's c# ?
What is COM Interoperability?
How to add a readonly property in c#.net
Explain how is the dll hell problem solved in .net?
What is a jagged array?
What is application c#?
What is a decimal c#?
What is action in c# 3.5?
What is default parameter in c#?
What are the generation of Garbage Collection in C# .NET ?
The int maps to which C# keyword in .NET type?
Why ienumerable is used in c#?
For methods inside the interface why can’t you specify the accessibility modifier?