21.05.2012, 20:01
I have an error with strtok:
The strtok function:
The pawn code line for each one is:
Код:
C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(28) : error 017: undefined symbol "strtok" C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(28) : error 010: invalid function or declaration C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(922) : error 021: symbol already defined: "strtok" C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(937) : error 047: array sizes do not match, or destination array is too small C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(27086) : error 047: array sizes do not match, or destination array is too small C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(27146) : error 047: array sizes do not match, or destination array is too small C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(27199) : error 047: array sizes do not match, or destination array is too small C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(27249) : error 047: array sizes do not match, or destination array is too small C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(27366) : error 047: array sizes do not match, or destination array is too small C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(27595) : error 047: array sizes do not match, or destination array is too small C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(27631) : error 047: array sizes do not match, or destination array is too small C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(27713) : warning 202: number of arguments does not match definition C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(27713) : warning 202: number of arguments does not match definition C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(27713) : warning 202: number of arguments does not match definition C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(27822) : error 047: array sizes do not match, or destination array is too small C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(27831) : error 047: array sizes do not match, or destination array is too small C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(28256) : error 047: array sizes do not match, or destination array is too small C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(28315) : error 047: array sizes do not match, or destination array is too small C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(28996) : error 047: array sizes do not match, or destination array is too small C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(29024) : error 047: array sizes do not match, or destination array is too small C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(29035) : error 047: array sizes do not match, or destination array is too small C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(29095) : error 047: array sizes do not match, or destination array is too small C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(29383) : error 047: array sizes do not match, or destination array is too small C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(29410) : error 047: array sizes do not match, or destination array is too small C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(29440) : error 047: array sizes do not match, or destination array is too small C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(29448) : error 047: array sizes do not match, or destination array is too small C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(29482) : error 047: array sizes do not match, or destination array is too small C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(29490) : error 047: array sizes do not match, or destination array is too small C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(29523) : error 047: array sizes do not match, or destination array is too small Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 26 Errors.
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;
}
pawn Код:
cmd = strtok(cmdtext, idx);