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

Difference between value and reference type.

873


What is difference between ienumerable and enumerable in c#?

852


What's c# ?

938


What is COM Interoperability?

909


How to add a readonly property in c#.net

881


Explain how is the dll hell problem solved in .net?

805


What is a jagged array?

867


What is application c#?

827


What is a decimal c#?

816


What is action in c# 3.5?

915


What is default parameter in c#?

904


What are the generation of Garbage Collection in C# .NET ?

912


The int maps to which C# keyword in .NET type?

982


Why ienumerable is used in c#?

830


For methods inside the interface why can’t you specify the accessibility modifier?

904