SA-MP Forums Archive
Strtok - erro - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: Strtok - erro (/showthread.php?tid=194899)



Strtok - erro - Ricop522 - 30.11.2010

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



Re: Strtok - erro - [Ips]Guh - 30.11.2010

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;
}



Re: Strtok - erro - Ricop522 - 30.11.2010

Muito obrigado. (:


Re: Strtok - erro - Kasura - 01.12.2010

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


Re: Strtok - erro - ipsBruno - 01.12.2010

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.


Re: Strtok - erro - ipsBruno - 01.12.2010

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.


Re: Strtok - erro - Andre_Elite - 01.12.2010

@Double Post TENSO


Re: Strtok - erro - TiagoPS - 01.12.2010

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?