SA-MP Forums Archive
Change length of array - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Change length of array (/showthread.php?tid=365014)



Change length of array - SEnergy - 01.08.2012

is there ANY way to dynamicaly change length of array?

in c++ you can do this
pawn Код:
int *a, b = 2;
a = new int[b];
//this will create array a with size 2 (b)
any way to do this in pawn?


Re: Change length of array - Vince - 01.08.2012

No. All array sizes must be known at compile time. You can initialize an array's size with a constant variable, but that's it.
pawn Код:
const b = 2;
new a[b];