this must be answered some time in the past, however I could not a particular way that I was looking for.
I want to make an array dimension of 7 x 2;
ex)
{0,0} {0,0}
{0,0}
...
...
..
.
int [,] myArray = new int[7,2];
Then I tried to treat each dimension of an array like one dimensional array.
So I tried to assign values to the array this way…
int[0] = new int{ 1, 2};
I think it should then look like…
{1 , 2}
{0 , 0}
...
..
.
but i get an error.
I believe it is due to my incomplete understanding of an array class.
What you want is a jagged array, not a multidimentional array. Essentially, an array of arrays:
The second “dimension” arrays are not bounded to a length of 2 however- you need to enforce that manually. This is why they are called jagged- visually, they can be of varying lengths:
All about arrays in C# here: http://msdn.microsoft.com/en-us/library/aa288453(v=vs.71).aspx