[Ajuda] Erro
#1

pawn Код:
G:\Documents and Settings\ALESSANDRO\Desktop\dealership.pwn(1180) : error 021: symbol already defined: "strtok"
G:\Documents and Settings\ALESSANDRO\Desktop\dealership.pwn(1195) : error 047: array sizes do not match, or destination array is too small
G:\Documents and Settings\ALESSANDRO\Desktop\dealership.pwn(1201) : error 047: array sizes do not match, or destination array is too small
G:\Documents and Settings\ALESSANDRO\Desktop\dealership.pwn(1234) : error 047: array sizes do not match, or destination array is too small
G:\Documents and Settings\ALESSANDRO\Desktop\dealership.pwn(1383) : error 047: array sizes do not match, or destination array is too small
Reply
#2

Tem 2 new strtok; na mesma funзгo...

o numero de letras na string й maior q o tamanho da string, por exemplo:

new string[12]; e na string tem + de 12 caracteres.
Reply
#3

vlw
Reply
#4

De nadega
Reply
#5

Tentei fazer. nгo deu. Strtok:
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;
}
na linha 1195 tem isso
pawn Код:
return result;
e nas outras linhas
pawn Код:
cmd = strtok(cmdtext, idx);
Help :S
Reply
#6

Qual erro?
Reply
#7

pawn Код:
G:\Documents and Settings\ALESSANDRO\Desktop\dealership.pwn(1180) : error 021: symbol already defined: "strtok"
G:\Documents and Settings\ALESSANDRO\Desktop\dealership.pwn(1195) : error 047: array sizes do not match, or destination array is too small
G:\Documents and Settings\ALESSANDRO\Desktop\dealership.pwn(1201) : error 047: array sizes do not match, or destination array is too small
G:\Documents and Settings\ALESSANDRO\Desktop\dealership.pwn(1234) : error 047: array sizes do not match, or destination array is too small
G:\Documents and Settings\ALESSANDRO\Desktop\dealership.pwn(1383) : error 047: array sizes do not match, or destination array is too small
Reply
#8

Quando eu usava strtok, eu colocava uma include assim:

#include "../include/gl_common.inc"

E nгo colocava esse esquema de strtok no final e funcionava perfeitamente.
Reply
#9

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;
}
meu strtok й assim, nem comparei com o seu
Reply
#10

nгo deu nenhum dos 2. =\
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)