Game Design Music and Art

array of out bounds – gaurdianAQ

gaurdianAQ

Member

Posts: 106
From:
Registered: 01-15-2007
what does the error array index out of bounds mean?
jestermax

Member

Posts: 1064
From: Ontario, Canada
Registered: 06-21-2006
it means you defined an array of a set length and you tried to access an element outside of that size. for example:

Array[] = new Array[20]; <--Array is declared to have 20 elements.
Depending on the language used, its either 0-19 or 1-20.

Array[21] = 5; <-- this will cause that error as you're trying to access something that isn't there

gaurdianAQ

Member

Posts: 106
From:
Registered: 01-15-2007
oh
Mene-Mene

Member

Posts: 1398
From: Fort Wayne, IN, USA
Registered: 10-23-2006
What he said, only in BB that would be.

Array(19)

Array(20) = 5

------------------
MM out-
Thought travels much faster than sound, it is better to think something twice, and say it once, than to think something once, and have to say it twice.
"Frogs and Fauns! The tournament!" - Professor Winneynoodle/HanClinto