c# int[3,3] 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: C# public 2d array
// in namespace, above main form declaration
public class Globals
{
public static string[,] tableArray;
}
//... in main or other method
Globals.tableArray = new string[rowLength,colLength];