二维数组如何循环输入 有代码 但我看不懂 大家帮解释一下

代码如下:
string[][]arr=new string[ds.table[0].rows.count][];
for(int ii=0;ii<ds.table[0].rows.count;ii++)
{
arr[ii]=new string[2];
arr[ii][0]=ds.table[0].rows[ii]["item1"];
arr[ii][1]=ds.table[0].rows[ii]["item2"];
}
看上去不是c语言啊,高手们帮忙看一下吧!

应该是C++语言
string[][]arr=new string[ds.table[0].rows.count][];
//定义二维数组
for(int ii=0;ii<ds.table[0].rows.count;ii++)
//设置循环
{
arr[ii]=new string[2];
arr[ii][0]=ds.table[0].rows[ii]["item1"];//为数组的第ii行第0列赋值
arr[ii][1]=ds.table[0].rows[ii]["item2"];//为数组的第ii行第1列赋值
}
温馨提示:答案为网友推荐,仅供参考
相似回答