What means this error ?

hi,

I get this error it is in one of my previous questions ;

What does it means ?,

IndexOutOfRangeException: Array index is out of range.

1 Answer

1

You're trying to access an invalid index from a container-type variable(List/Array/Hashtable). Either the 'container' isn't initialized or you're reaching for a non-int, or a negative int. In any case, the problem is you're calling an inexistant value.

People often have an off-by-one error. Mind that an array has a range starting with 0. So an array of 3 has index: 0,1,2. 3 is already OutOfBounds.

–

Without seeing the code that produces this error, there's nothing else to add ;)

–