Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ArrayCopy
- {
- class ArrayCopy
- {
- static void Main()
- {
- int[] source = new int[5];
- source[0] = 2;
- source[1] = 3;
- source[2] = 4;
- source[3] = 5;
- source[4] = 6;
- for (int i = 0; i < source.Length; i++)
- {
- Console.WriteLine(source[i]);
- }
- int[] target = new int[5];
- Array.Copy(source, target, 5);
- Console.WriteLine("Copied elements from source to target:");
- for (int i = 0; i < target.Length; i++)
- {
- Console.WriteLine(target[i]);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement