c# how to make array code example
Example 1: c# array
int[] array = new int[]{1, 2, 3, 4, 5};
for(int i=0; i<array.Length; i++){
Console.WriteLine(array[i]);
}
Example 2: c# create array
// Define and Initialize
int[] arr = {1, 2, 3};
// Buuuut:
// Initial defining
int[] arr;
// This works
arr = new int[] {1, 2, 3};
// This will cause an error
// arr = {1, 2, 3};
Example 3: hwo to make an array in C#
int[] Nameofarray = new int[how much is the max];
for example:
int[] X = new int[5];