Index was outside the bounds of the array (C#)

后端 未结 3 1587
[愿得一人]
[愿得一人] 2020-12-12 07:28

I get \"Index was outside the bounds of the array\" on this line, what\'s wrong?

Kort[x, y] = Sort[x] + Valor[y] + \" \";    

Below is the

3条回答
  •  遥遥无期
    2020-12-12 07:54

    in C# arrays are zero-based...

    look at what Kevek answered you plus:

    this:

    for (this.x = 1; this.x <= 4; this.x++)
    {
      for (this.y = 1; this.y <= 13; this.y++)
      ...
    

    should be:

    for (this.x = 0; this.x < 4; this.x++)
    {
      for (this.y = 0; this.y < 13; this.y++)
      ...
    

提交回复
热议问题