Hallo,
ich wollte euch mal fragen, was "EOS" bedeutet.
// ========== STRGET ==========
stock strget(strx[], pos, search = ' ') {
new arg, ret[128], idxx;
for (new i = 0; i < strlen(strx); i++) {
if(strx[i] == search || i == strlen(strx) || strx[i + 1] == 10) {
arg++;
if (arg == pos + 1){
ret[i-idxx] = EOS; // <==============================
return ret;
} else if (arg == pos)
idxx= i+1;
}
else if (arg == pos)
ret[i - idxx] = strx[i];
}
return ret;
}
// ========== STRTOK ==========
stock strtok(const string[], &index,seperator=' ') {
new length = strlen(string);
new offset = index;
new result[255];
while ((index < length) && (string[index] != seperator) && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS; // <==============================
if ((index < length) && (string[index] == seperator))
{
index++;
}
return result;
}
Hoffe, jemand kann mir die Augen öffnen