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
What is int32 in c#?
Can we customize the serialization process?
What are extensions methods in c#?
Is overriding of a function possible in the same class?
What is int16?
What are the concepts of dispose method?
What are delegates and why are they required?
What are the different types of constructors in c#?
What is multithreading with .net?
Can structs in c# have destructors?
How do you escape a character?
What is int64 in c#?
What is the c# equivalent of c++ catch (…), which was a catch-all statement for any possible exception? Does c# support try-catch-finally blocks?
What is a template class?
What are reflections in c#?