class Example
{
static void Use(int[,] grid)
{
int rowLength =
grid.GetLength(0);
int colLength =
grid.GetLength(1);
for (int row = 0; row != rowLength; row++)
{
for
(int col = 0; col != colLength; col++)
{
Console.WriteLine(grid[row,col]);
}
}
}
static void Main()
{
Use(new int[,]{ {1,2,3},
{4,5,6} });
...
}
}