This code copies a specified number of bytes (not elements) in an array to another array. The code copies only 2 Int32 elements to the second array as the number of bytes specified is 8.
int[] a1 = new int[5] {12,34,52,15,64}; int[] a2 = new int[5]; System.Buffer.BlockCopy(a1,0,a2,0,8); foreach (int i in a2) MessageBox.Show(i.ToString());
|
No responses found. Be the first to respond and make money from revenue sharing program.
|