B
B
BadCats2018-03-23 16:47:36
C++ / C#
BadCats, 2018-03-23 16:47:36

Index out of range?

5ab504e228ff2798725025.jpeg
As you can see, the size of Image_Name_List is 4 , but nevertheless, for some reason, it goes beyond the array. Why is this happening?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
#
#, 2018-03-23
@BadCats

in general, it is clear that i is not visible at the same time, if i is greater than 0 (yes, yes, according to the tradition of C-language languages, everything is indexed from 0), then it is precisely such an error that will arise what is Capacity , see here List.Capacity property (quite briefly - this is how much links reserved for the moment, but not many ) ps if still not clear - the actual size is the List.Count PropertyImage_Name_List.Count = 1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question