Iterate through 2 dimensional array c#

后端 未结 7 1525
悲&欢浪女
悲&欢浪女 2020-12-03 16:37
for(int k=0;k <= odds.GetLength(-1);k++)

The above line of code is supposed to iterate through a two dimensional array of type Double but keeps

7条回答
  •  感情败类
    2020-12-03 17:20

    If odds is a two-dimensional array, then its dimensions will be called 0 and 1. Trying to access dimension -1 will yield an IndexOutOfRangeException.

提交回复
热议问题