How can I get the value of an array in a multidimensional array...in another array?
I want to get the value of test in ascending order in the following code.
I tried to use a for and foreach loops but have had problems when it comes to referencing an element of the multidimensional array.
static void Main(string[] args)
{
string[][,][] test = { new string[,][]{{
new string[]{"test1","test2","test3"},
new string[]{"test4","test6","test6"}
},
{
new string[]{"test7","test7","test9"},
new string[]{"test10","test11","test12"}
}},
new string[,][]{{
new string[]{"test13","test14","test15"},
new string[]{"test16","test17","test18"}
},
{
new string[]{"test19","test20","test21"},
new string[]{"test22","test23","test24"}
}}
};
for (int a = 0; a < test.Count(); a++ )
{
foreach(var am in test[a])
{
for (int ama = 0; ama < am.Count(); ama++)
{
Console.WriteLine("{0}",test[a][0,0][ama].ToString()); //what should I put in [0,0]?
}
}
}
Console.ReadKey();
}