Advertisement
IceNight

Untitled

May 28th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.43 KB | None | 0 0
  1. stock strtok(const string[], &index,seperator=' ')
  2. {
  3.              new length = strlen(string);
  4.     new offset = index;
  5.     new result[MAX_STRING];
  6.     while ((index < length) && (string[index] != seperator) && ((index - offset) < (sizeof(result) - 1)))
  7.     {
  8.         result[index - offset] = string[index];
  9.         index++;
  10.     }
  11.  
  12.     result[index - offset] = EOS;
  13.     if ((index < length) && (string[index] == seperator))
  14.     {
  15.         index++;
  16.     }
  17.     return result;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement