SA-MP Forums Archive
Calculation in string declaration - 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: Calculation in string declaration (/showthread.php?tid=338269)



Calculation in string declaration - darklight94 - 29.04.2012

Hi, is it possible to do something like that:
Код:
new cnt = 5
new string[cnt*11];



Re: Calculation in string declaration - Lorenc_ - 29.04.2012

.No.


Re: Calculation in string declaration - darklight94 - 29.04.2012

Is there any other method to do this ?


Re: Calculation in string declaration - Niko_boy - 29.04.2012

No this will give you certain errors
rather you can try this
Код:
#define cnt (12)

new string[cnt*11];
printf("%d",sizeof(string));
will print 132

Quote:
Originally Posted by darklight94
Посмотреть сообщение
Is there any other method to do this ?
^


Re: Calculation in string declaration - Ash. - 29.04.2012

Edit: Sorry. Misread the original post.


Re: Calculation in string declaration - darklight94 - 29.04.2012

So, it is possible to get the number of rows of a MySQL table define the value and multiply it with 11 in a string declaration?


Re: Calculation in string declaration - IceCube! - 29.04.2012

In short No.


Re: Calculation in string declaration - Niko_boy - 29.04.2012

No its not possible.