title: I am attempting to create a strtok function from scratch using arrays
body: <p>I am not sure where to go from here. I am trying to do the strtok function from scratch using arrays. I wanted store each token in the temp array, print it, and keep doing this for as many tokens the array would have. For instance, a string such as "this is fab" I wanted "this", to be copied over to temp until the delimiter( null, or space or any character) was encountered. Then printed. The final result of everything should have been:</p>
  
  <p>this \n</p>
  
  <p>is \n</p>
  
  <p>fab \n</p>
  
  <p>Does anyone have any insight. </p>
  
  <pre><code>char strtok( char s[], char key)
  {
  char find;
  char temp[100] = " ";
  
  int i = 0;
  while( s[i] != '\0')
  {
      i++;
      for(; s[find] != key &amp;&amp; s[find] != '\0'; find++)
      {
          temp[i]= s[find];
      }
              cout&lt;&lt;endl;
  
      }
  
  for( int x = 0; temp[x] != '\0'; x++)
      {
          cout&lt;&lt;temp[x];
      }
  
      cout&lt;&lt;endl;
  }
  </code></pre>