Strtok - erro
#1

pawn Код:
strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }

    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}
Код:
error: 021: symbol already defined: "strtok" (Linha acima /\)
error: 047: array sizes do not match, or destination array is too small (	return result;)
error: 047: array sizes do not match, or destination array is too small ( 	cmd = strtok(cmdtext, idx); )
error: 047: array sizes do not match, or destination array is too small (  tmp = strtok(cmdtext, idx); )
error: 047: array sizes do not match, or destination array is too small (  tmp = strtok(cmdtext, idx); )
array sizes do not match, or destination array is too small (  tmp = strtok(cmdtext, idx); )
error: 047: array sizes do not match, or destination array is too small (  tmp = strtok(cmdtext, idx); )
error: 047: array sizes do not match, or destination array is too small(  tmp = strtok(cmdtext, idx); )
error: 047: array sizes do not match, or destination array is too small(  tmp = strtok(cmdtext, idx); )
error: 047: array sizes do not match, or destination array is too small(  tmp = strtok(cmdtext, idx); )
error: 047: array sizes do not match, or destination array is too small(  tmp = strtok(cmdtext, idx); )
error: 047: array sizes do not match, or destination array is too small(  tmp = strtok(cmdtext, idx); )
error: 047: array sizes do not match, or destination array is too small(  tmp = strtok(cmdtext, idx); )
error: 047: array sizes do not match, or destination array is too small(  tmp = strtok(cmdtext, idx); )
error: 047: array sizes do not match, or destination array is too small(  tmp = strtok(cmdtext, idx); )
error: 047: array sizes do not match, or destination array is too small(  tmp = strtok(cmdtext, idx); )
error: 047: array sizes do not match, or destination array is too small(  tmp = strtok(cmdtext, idx); )
error: 047: array sizes do not match, or destination array is too small(  tmp = strtok(cmdtext, idx); )
error: 047: array sizes do not match, or destination array is too small(  tmp = strtok(cmdtext, idx); )
error: 047: array sizes do not match, or destination array is too small(  tmp = strtok(cmdtext, idx); )
error: 047: array sizes do not match, or destination array is too small(  tmp = strtok(cmdtext, idx); )
error: 047: array sizes do not match, or destination array is too small(  tmp = strtok(cmdtext, idx); )
error: 047: array sizes do not match, or destination array is too small(  tmp = strtok(cmdtext, idx); )
error: 047: array sizes do not match, or destination array is too small(  tmp = strtok(cmdtext, idx); )
error: 047: array sizes do not match, or destination array is too small(  tmp = strtok(cmdtext, idx); )
error: 047: array sizes do not match, or destination array is too small
Reply
#2

muda de strtok para strtok2....
ficando assim :
pawn Код:
strtok2(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }

    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}
Reply
#3

Muito obrigado. (:
Reply
#4

melhor ainda exclui seu strtok
deixar ele ali й perda de eficassia no script e ganho de bytes
Reply
#5

Quote:
Originally Posted by Kasura
Посмотреть сообщение
melhor ainda exclui seu strtok
deixar ele ali й perda de eficassia no script e ganho de bytes
Kasura,atualmente o compilador desconhece stocks funcao() caso ela nгo forem usadas.
Reply
#6

Quote:
Originally Posted by Kasura
Посмотреть сообщение
melhor ainda exclui seu strtok
deixar ele ali й perda de eficassia no script e ganho de bytes
Kasura,atualmente o compilador desconhece stocks funcao() caso ela nгo forem usadas.

Caso seja funcao() dai ele reconhece,porйm raramente alguйm usa isto.
Reply
#7

@Double Post TENSO
Reply
#8

Quote:
Originally Posted by [FeK]DraKiNs
Посмотреть сообщение
Kasura,atualmente o compilador desconhece stocks funcao() caso ela nгo forem usadas.

Caso seja funcao() dai ele reconhece,porйm raramente alguйm usa isto.
Eu Uso

Mas qual a diferenзa de :

pawn Код:
Comer(playerid)
stock Comer(playerid)
public Comer(playerid)
Qual Fica Mais Otimixada?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)