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
How do you inherit a class into other class in c#?
Is java better than c sharp?
What is the difference between “finalize” and “finally” methods in c#?
what are the differences between a class and structure
Can a constructor have a return type?
Why can't we use a static class instead of singleton?
Which are the access modifiers available in c#?
Are c# objects passed by reference?
What is the difference between namespace and class in c#?
What is firstordefault c#?
What is an event in c#?
What is a generic method?
How do I do implement a trace?
What is c# best for?
Is char * null terminated?