title: Split a string into an array in C++
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/236129/how-to-split-a-string-in-c">How to split a string in C++?</a>  </p>
  </blockquote>
  
  
  
  <p>I have an input file of data and each line is an entry. in each line each "field" is seperated by a white space " " so I need to split the line by space. other languages have a function called split (C#, PHP etc) but I cant find one for C++. How can I achieve this? Here is my code that gets the lines: </p>
  
  <pre><code>string line;
  ifstream in(file);
  
  while(getline(in, line)){
  
    // Here I would like to split each line and put them into an array
  
  }
  </code></pre>