Created
November 28, 2020 22:12
-
-
Save vxcute/9a0b91166891ebdf9fc87fcc99ccf590 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace arrays | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
int[] arr = new int[5] { 1, 2, 3, 4, 5 }; | |
int[] arr2 = new int[5]; | |
Array.Reverse(arr); | |
foreach(var i in arr) { Console.WriteLine(i); } | |
Console.WriteLine("======================"); | |
copy_arr_to_arr(ref arr, ref arr2); | |
foreach(var i in arr2) { Console.WriteLine(i); } | |
Console.ReadLine(); | |
} | |
public static void copy_arr_to_arr(ref int[] arr, ref int[] arr2) | |
{ | |
Array.Reverse(arr); | |
arr2 = arr; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment