用户代码未处理 InDexOutOfRangeException 索引超出了数组界限,
用户代码未处理InDexOutOfRangeException索引超出了数组界限,这儿的nongli_diyitian_yangli是赋值,将二维数组中的字符串转化为整数...
用户代码未处理 InDexOutOfRangeException 索引超出了数组界限,这儿的nongli_diyitian_yangli是赋值,将二维数组中的字符串转化为整数,没有错误,前面运行通过了,nongli_yangli_riqi也是一个二维数组,因为getlength(0),getlength(1)是变化的,不能确定,只有赋值完成后才能确定。这个问题这么处理。
展开
1个回答
展开全部
string[] defines an array, usually array's index starts from 0 and ends with the array's length-1.
For example, an array list1 of length 3, there are 3 elements in the array, they are list1[0], list1[1], and list1[2]. If you visit list1[3], since it is the *FOURTH* element of the array, you will get the error: index out of bounds.
In your code, you should use the following code to loop through an array:
for (int i = 0; i < cclist.Length; i++) {
}
For example, an array list1 of length 3, there are 3 elements in the array, they are list1[0], list1[1], and list1[2]. If you visit list1[3], since it is the *FOURTH* element of the array, you will get the error: index out of bounds.
In your code, you should use the following code to loop through an array:
for (int i = 0; i < cclist.Length; i++) {
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询