String Array Size
#1

Hi everyone,

I'm trying to use iterator with string. But I have a problem with string's array size. For example; I'm adding a value to iterator, at the same time changing the value of the string that have ID with the same as iterator value.

Like;
PHP код:
new Iterator:myiter<MAX_PLAYERS>, mystr[size][24];
new 
id Iter_Free(myiter);
Iter_Add(myiterid);
format(mystr[id], 24"%s"pName(playerid)); 
If i set the size of string array to MAX_PLAYERS, it will be too large. I want that the strings array as large as Iterators current size. How can i do it?

Or is there any way to make something like string Iterator?

For example;
PHP код:
Iter_Add(myiter"test"); 
Reply
#2

You cant, pawn does not have dynamic memory allocation. There is y_malloc include by ****** (part of YSI) and vectorial (c++ vectors) plugin for pawn. Check them out.
Reply
#3

Quote:
Originally Posted by Novacaine
Посмотреть сообщение
If i set the size of string array to MAX_PLAYERS, it will be too large.
A whole 96 kilobytes. Assuming that MAX_PLAYERS is still set to 1000. What is this? The 50's?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)