Raised This Month: $ Target: $400
 0% 

Error: Array index out of bounds - Solved.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
V0LuMe
Junior Member
Join Date: Aug 2014
Old 08-28-2014 , 18:16   Error: Array index out of bounds - Solved.
Reply With Quote #1

Hey All,

i have compiling error : Array Index Out Of Bounds( i say it in title. )

hmm , the code :

Code:
enum _:BlaBla_Enum {
	InMenu[ 32 ],
	InNumber[ 32 ]
}

new const BlaBla[ ][ BlaBla_Enum ] = {
	{ "\wsasafas", 0 },
	{ "\wasfasf", 1 },
	{ "\wdfhdfh", 2 },
	{ "\wdfhdfghfh", 3 },
	{ "\wvbnfjnfgjjj", 4 },
	{ "\weqwtqetwet", 5 }
}
i say the line with the error :
Code:
if(BlaBla[ item ][ InNumber ] == 0) { // this is the line with the error ( in menu handler ).
		BlaBla_Menu(client);
}

Last edited by YamiKaitou; 08-28-2014 at 18:54.
V0LuMe is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-28-2014 , 18:20   Re: Error: Array index out of bounds
Reply With Quote #2

Code:
enum _:BlaBla_Enum {
	InMenu[ 32 ],
	InNumber
}

new const BlaBla[][ BlaBla_Enum ] = {
	{ "\wsasafas", 0 },
	{ "\wasfasf", 1 },
	{ "\wdfhdfh", 2 },
	{ "\wdfhdfghfh", 3 },
	{ "\wvbnfjnfgjjj", 4 },
	{ "\weqwtqetwet", 5 }
}
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).

Last edited by YamiKaitou; 08-28-2014 at 18:21.
YamiKaitou is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 08-28-2014 , 18:27   Re: Error: Array index out of bounds
Reply With Quote #3

And lil explanation: Simply InNumber is not a string, bu integer, so you don't need to put array size on it (talking about the [ 32] that Yami removed).
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
V0LuMe
Junior Member
Join Date: Aug 2014
Old 08-28-2014 , 18:35   Re: Error: Array index out of bounds
Reply With Quote #4

Ty But I have this compile error again ..
Error: Array index out of bounds (variable "BlaBla") on line 107

Last edited by V0LuMe; 08-28-2014 at 18:37.
V0LuMe is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-28-2014 , 18:37   Re: Error: Array index out of bounds
Reply With Quote #5

Quote:
Originally Posted by V0LuMe View Post
Ty But I have this compile error again ..
What is the error? You haven't told us a compile error yet.

EDIT for your EDIT: That is not a compile error. We don't have enough code to help you
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).

Last edited by YamiKaitou; 08-28-2014 at 18:38.
YamiKaitou is offline
V0LuMe
Junior Member
Join Date: Aug 2014
Old 08-28-2014 , 18:40   Re: Error: Array index out of bounds
Reply With Quote #6

Quote:
Originally Posted by YamiKaitou View Post
What is the error? You haven't told us a compile error yet.

EDIT for your EDIT: That is not a compile error. We don't have enough code to help you
So What i can do .? There was no error before the last edit, in the last edit, i get this error.
V0LuMe is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-28-2014 , 18:43   Re: Error: Array index out of bounds
Reply With Quote #7

Quote:
Originally Posted by V0LuMe View Post
So What i can do .? There was no error before the last edit, in the last edit, i get this error.

Give us more code
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
V0LuMe
Junior Member
Join Date: Aug 2014
Old 08-28-2014 , 18:44   Re: Error: Array index out of bounds
Reply With Quote #8

Quote:
Originally Posted by YamiKaitou View Post
Give us more code
edit :

Oh, I fixed the code, the error was in other enum, but why the compiler say this line T_T..

its Because i set on another enum the same name ? ( InNumber ) ?

Last edited by V0LuMe; 08-28-2014 at 18:52.
V0LuMe is offline
Reply



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 02:00.


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