Answers for "how to use a 2d array in csharp"

C#
3

how to use a 2d array in csharp

int[,] arr = new int[3,3];//declaration of 2D array  
int[,] arr = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 }}//another way to declare
arr[1,2]=20; //access to the array
Posted by: Guest on October-18-2020
3

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];
Posted by: Guest on March-18-2020

Code answers related to "how to use a 2d array in csharp"

C# Answers by Framework

Browse Popular Code Answers by Language