For example:
int[,] multiArray = new int[2, 4] { { 1, 2, 3, 4 }, { 5, 6, 7, 8 } };
for (int Row = 0; Row < multiArray.GetLength(0); Row++)
{
for (int Col = 0; Col < multiArray.GetLength(1); Col++)
{
TextBox.Text += multiArray[Row, Col] + " ";
}
TextBox.Text += "\r\n";
}
The code above would produce:
1 2 3 4
5 6 7 8
How do I name my 2 rows as 2014, 2015 and name my 4 columns as January, April, July, October?
Value [2014, January] or index [0, 0] = 1,
Value [2014, April] or index [0, 1] = 2,
Value [2014, July] or index [0, 2] = 3,
Value [2014, October] or index [0, 3] = 4,
Value [2015, January] or index [1, 0] = 5,
Value [2015, April] or index [1, 1] = 6,
Value [2015, July] or index [1, 2] = 7,
Value [2015, October] or index [1, 3] = 8
And when I print out to TextBox by click a button would produce like the output below?
January April July October
2014 1 2 3 4
2015 5 6 7 8