Possible Duplicate:
C# memcpy equivalent
Kindly tell me any equivalent function of memcpy in c#?
Possible Duplicate:
C# memcpy equivalent
Kindly tell me any equivalent function of memcpy in c#?
There is none. C# protects the actual memory behind several layers of abstraction. For some purposes, the IClonable interface may be of some help though.
Not an exact equivalent, but does Array::Copy do what you need to do?
For copying (byte) arrays, you can use the Array.Copy() method, but that's probably not what you want:
byte[] array1 = new byte[10] { 1,2,3,4,5,6,7,8,9,10 };
byte[] array2 = new byte[10];
Array.Copy(array1,array2,10);
You can use unsafe and pointers. But your particular case would say a bit more about what direction you should head.
Buffer.BlockCopy is close, but limited to arrays. I agree it depends what you're trying to do.
there's an example on the MSDN page, that uses byte[] to copy memory directly. Maybe that's what you're looking for...
As already said it depends what you are trying to do... So you can consider one of these... check the links:
There may be other possible options based on your needs...