Fatal Error 100 cannot read from file: "strtok"
#1

: fatal error 100: cannot read from file: "strtok"

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#2

Delete that line (#include <strtok>)
And add this instead:

Код:
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;
}
You should look into using sscanf though, it's a lot faster and easier to use.
Reply
#3

DELETED.
Reply
#4

Quote:
Originally Posted by Stinged
Посмотреть сообщение
Delete that line (#include <strtok>)
And add this instead:

Код:
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;
}
You should look into using sscanf though, it's a lot faster and easier to use.
thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)