Raised This Month: $ Target: $400
 0% 

Wierdness with arrays returning wrong value.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Trp. Jed
Member
Join Date: Aug 2004
Old 10-13-2004 , 18:36   Wierdness with arrays returning wrong value.
Reply With Quote #1

I've defined an array at the top of my code as follows:

Code:
new liveGrens[2] = {0, 0}

And, at the end of the plugin_init, just to be sure (because of this bug) i'm zero it again with:

Code:
liveGrens[0] = 0 liveGrens[1] = 0

Now I've gone through my code and the only operations I do on this array is adding or subtracting one from the value with, for example:

Code:
liveGrens[0] += 1 liveGrens[1] -= 1

Thing is, liveGrens[1] is fine and never has a problem but liveGrens[0] for some reason seems to hold some stupidly high number, for example 1147707392 even after its initialised and before anything is done with it.

I have gone over my code and checked theres no erronious assignment operators instead of comparison ones and it looks fine.

Anyone have any idea what it is?

I can probably code a work around but I'd rather not do it if its something simple to fix that I've overlooked.
Trp. Jed is offline
 



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 17:14.


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