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

How do you inherit a class into other class in c#?

916


Is java better than c sharp?

951


What is the difference between “finalize” and “finally” methods in c#?

910


what are the differences between a class and structure

1112


Can a constructor have a return type?

861


Why can't we use a static class instead of singleton?

872


Which are the access modifiers available in c#?

954


Are c# objects passed by reference?

892


What is the difference between namespace and class in c#?

940


What is firstordefault c#?

931


What is an event in c#?

889


What is a generic method?

962


How do I do implement a trace?

1074


What is c# best for?

930


Is char * null terminated?

928