Raised This Month: $ Target: $400
 0% 

array index out of bounds


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 04-14-2005 , 23:12  
Reply With Quote #7

Quote:
Originally Posted by Bone
what?

what do you mean
What I meant was that you tried to access an index of the array that is out-of-bounds.. fortunately, that is exactly what the compiler tells you!!

If you declare an array of 3 values, then you can only access the array with 3 indexes (namely: 0, 1, 2)

But what you did is create an array of 3, and then tried accessing 6 indexes (namely: 0, 1, 2, 3, 4, 5).. look here in your code:

Code:
 new origin[3], checkorigin[3], validpos; //[...]             checkorigin[0] = bankposX[i];             checkorigin[1] = bankposY[i];             checkorigin[2] = bankposZ[i];             checkorigin[3] = bankposA[i];             checkorigin[4] = bankposB[i];             checkorigin[5] = bankposC[i];

The 'checkorigin' is only an array of 3, but you are trying to access 6 indexes..

Solution: make two different arrays of 3, or make the one array an array of 6..

I hope that helps..
xeroblood is offline
Send a message via MSN to xeroblood
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:50.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode