Strtok problem
#3

Undefined symbol "strtok" problem solving with:
pawn Код:
stock 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;
}
I prefer using strtok(const string[], &index) because you use it for 2 parts, and with seperator its 3 I think, not sure, and make the size bigger of error 47 line (e.g. if you have
pawn Код:
new string[100];
change it to for example
pawn Код:
new string[200];
Reply


Messages In This Thread
Strtok problem - by LasTRace - 07.08.2010, 11:43
Re: Strtok problem - by LasTRace - 07.08.2010, 12:02
Re: Strtok problem - by Claude - 07.08.2010, 12:46
Re: Strtok problem - by Hiddos - 07.08.2010, 12:49
Re: Strtok problem - by TheChaoz - 07.08.2010, 13:37
Re: Strtok problem - by LasTRace - 07.08.2010, 13:50

Forum Jump:


Users browsing this thread: 3 Guest(s)