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?
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
Post a Comment