我是C#的新手,但有我正在学习的项目,需要一些指导。 我有多个数组,我称之为array1,array2,array3,array4等等直到array9。 现在用户输入数字到输入框中,我将输入像543分成5 4 3 ,我想动态调用C#根据用户输入动态访问变量
array5 array4 array3。所以基本上在控制台上显示这些数组的内容。
string value = input.Text.ToString();
foreach (string s in Array[value[0]])
{
-- will loop through all values of array and out put
foreach (string s in Array[value[1]])
{
-- will loop through all values of array and out put
foreach (string s in Array[value[2]])
{
-- will loop through all values of array and out put
}
}
}
我该如何做到这一点?请帮助
为什么有9个数组变量?整个收集点是消除变量的多重性。 – user2864740 2014-10-05 06:40:45
我也不明白。你是否想要为每个数字创建一个数组? – Kaj 2014-10-05 06:43:06
做数组或数组:array [9] [n],现在你可以访问X数组,例如数组[4] [2] = ... – AsfK 2014-10-05 06:43:27