Register
#1

Hi
How fix these errors as a please help as not being English

Код:
C:\samp\gamemodes\SF.pwn(2198) : error 021: symbol already defined: "strtok"
C:\samp\gamemodes\SF.pwn(2213) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Код:
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;
}
Reply
#2

Quote:
Originally Posted by LukiuzZ
Hi
How fix these errors as a please help as not being English

Код:
C:\samp\gamemodes\SF.pwn(2198) : error 021: symbol already defined: "strtok"
C:\samp\gamemodes\SF.pwn(2213) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Код:
strtok(const string[], &index)


Please Help
{
	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;
}
Reply
#3

Euh, did you even read the errors?


Код:
error 021: symbol already defined: "strtok"
You already defined strtok. Undefine one of your strtoks.


Код:
error 047: array sizes do not match, or destination array is too small
Try increasing the size of the array.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)