Monday 15 February 2010

c# - Get the value of array in multidimensional-array in array -



c# - Get the value of array in multidimensional-array in array -

how can value of array in multidimensional array...in array?

i want value of test in ascending order in next code.

i tried utilize for , foreach loops have had problems when comes referencing element of 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"} }} }; (int = 0; < test.count(); a++ ) { foreach(var in test[a]) { (int ama = 0; ama < am.count(); ama++) { console.writeline("{0}",test[a][0,0][ama].tostring()); //what should set in [0,0]? } } } console.readkey(); }

why not:

console.writeline("{0}", am[ama].tostring());

c# arrays multidimensional-array

No comments:

Post a Comment