c# - Why there is "index exceeded the number of group boundaries" in this code? -


for code in visual studio

point[,] point = new point[9, 10]; (int = 0; < 9; i++)  {   for(int j = 0; < 10; j++)    {     point[i, j].x = i;//mark1     point[i, j].y = j;        }  } 

at //mark1,system tell me"index exceeded number of group boundaries"

why?

enter image description here

you doing

for (int j = 0; < 10; j++) 

so condition i < 10 maybe typo causing loop go out of range in array (you trying access eleement 0, 10 in array)

replace with:

for (int j = 0; j < 10; j++) 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

Python Tornado package error when running server -

Qt QGraphicsScene is not accessable from QGraphicsView (on Qt 5.6.1) -