title: Problem in splitting an input into positions of an array in C
body: <p>I'm learning C and I'm having a problem splitting a string of text.
  I want the user to type many words separated by space in one line, then the program will split this words and save each of them in a position of the array named <em>list</em>, in order to do this I'm trying to use the <em>strtok()</em> function but Im running into some warnings and errors but I can't see what im doing wrong.</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  
  int main(int argc, char *argv[])
  {
      char list[1000];
      char input[1000];
  
  
      printf(&quot;Type:\n&quot;); //test
  
      scanf(&quot;%1000[^\n]&quot;, &amp;input);
  
      char* split = strtok(input, &quot; &quot;);
      while(split != NULL) 
      {
          int count = 0;
          list[count] = split;
          count++;
          split = strtok(NULL, &quot; &quot;);
      }
  
      printf(&quot;%s %s\n&quot;, list[0], list[1]); //test
  
  
  
  
      return 0;
  } 
  </code></pre>