title: How to use strtok() using a string argumnet instead of character array?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/289347/using-strtok-with-a-string-argument-instead-of-char">Using strtok with a string argument (instead of char*)?</a>  </p>
  </blockquote>
  
  
  
  <p>When using <code>strtok()</code> i do the following </p>
  
  <pre><code>char str[300];
  while(infile) {
    infile.getline(str,300);
    char* token=strtok(str," ");
  </code></pre>
  
  <p>How can i use a string instead of the character array <code>char str[300];</code>            </p>
  
  <p>is there a way to use it to be like this,<code>string str;
      while(infile) {
        infile.getline(str,300);
        char* token=strtok(str," ");</code></p>