title: Splitting a line in C/C++ using whitespace as delimiter
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/53849/how-do-i-tokenize-a-string-in-c">How do I tokenize a string in C++?</a>  </p>
  </blockquote>
  
  
  
  <p>pseudocode: </p>
  
  <pre><code>    Attributes[] = Split line(' ')
  </code></pre>
  
  <p>How?</p>
  
  <p>I have been doing this:</p>
  
  <pre><code>  char *pch;
    pch = strtok(line," ");
    while(pch!=NULL)
    {
        fputs ( pch, stdout ); 
  
  
    }
  </code></pre>
  
  <p>and getting a non-written, stuck, exit file. It's something wrong with this?
  Well, the thing isn't even meeting my pseudocode requirement, but I'm confused about how to index tokens (as char arrays) to my array, I guess I should write a 2-dim array?  </p>