Raised This Month: $ Target: $400
 0% 

dynamic allocated arrays possible?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ripcurl2
Member
Join Date: Oct 2004
Old 01-14-2005 , 17:15   dynamic allocated arrays possible?
Reply With Quote #1

another nice problem i have worked myself into
here the thing code:
Code:
.... new count = 0 .... count = dbi_field(result, 1) //count becomes the number in the field (about 3000) new iTempArray[count][32]

results in this compiler error:
amxxsc: sc1.c:1727: cell adjust_indirectiontables(int *, int, int, int, int, constvalue *): Assertion `dim[cur]>0' failed.

in essence: the compiler wants a statically assigned array like this:
Code:
new iTempArray[3000][32]

my question:
is there a way to make the compiler swallow dynamic (=size determined @ runtime) allocated arrays? (as done in the first code segment)
ripcurl2 is offline
BlueRaja
Senior Member
Join Date: Nov 2004
Old 01-14-2005 , 19:48  
Reply With Quote #2

small doesn't use dynamic arrays
BlueRaja is offline
Send a message via AIM to BlueRaja Send a message via MSN to BlueRaja
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 01-14-2005 , 20:03  
Reply With Quote #3

For this, you will need to use the Array Module, which is a pain in the butt from what I've heard.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
ripcurl2
Member
Join Date: Oct 2004
Old 01-14-2005 , 20:30  
Reply With Quote #4

no need, found another way to solve this stuff. i kinda dug into sql queries with a l33t coder here. Got some wicked results here a sample

Code:
dbi_query(g_dbc,"UPDATE `%s`,`%s` SET `%s`.kills=`%s`.kills+`%s`.kills,`%s`.score=`%s`.score+`%s`.score,`%s`.teamkills=`%s`.teamkills+`%s`.teamkills,`%s`.deaths=`%s`.deaths+`%s`.deaths,`%s`.hits=`%s`.hits+`%s`.hits,`%s`.shots=`%s`.shots+`%s`.shots,`%s`.headshots=`%s`.headshots+`%s`.headshots where `%s`.authid=`%s`.authid",dst,src,dst,dst,src,dst,dst,src,dst,dst,src,dst,dst,src,dst,dst,src,dst,dst,src,dst,dst,src,dst,src)
and more of course , but this one was the master of confusion. If you look at it too long, you see a purple wizzard shooting fireballs at you from the left.


have fun decoding that
ripcurl2 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 19:28.


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