strtok problem
#4

Easy one
Код:
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


Messages In This Thread
strtok problem - by DaneAMattie - 13.11.2010, 23:25
Re: strtok problem - by Retardedwolf - 13.11.2010, 23:32
Re: strtok problem - by DaneAMattie - 13.11.2010, 23:33
Respuesta: strtok problem - by kirk - 13.11.2010, 23:37

Forum Jump:


Users browsing this thread: 5 Guest(s)