array of integers c# code example
Example 1: 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 2: make new array in c#
string[] stringArray = new string[6];
Example 3: c# create array with n elements
int[] arr = Enumerable.Range(0, X+1).ToArray();