Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Can you pass parameters to destructors?

1114


Are enums static c#?

1031


What is default value of bool in c#?

1001


Define satellite assembly in c#?

958


Can interface inherit class in c#?

1033


Explain the Different types of configuration files in .net?

1050


What are the types of methods in c#?

1051


What is the lock statement in c#?

1041


What is the difference between an integer and int?

968


Can we inherit private class in c#?

995


How many bytes is a long c#?

992


What is a framework in c#?

991


How is exception handling implemented in c#?

1094


Name some properties of array.

1026


What is datatable in c#?

1005