title: What is a good way to read in and separate information from this text file?
body: <p>Let's say I have a text file:</p>
  
  <pre><code>83 71 69 97Joines, William B.
  100 85 88 85Henry, Jackson Q.
  </code></pre>
  
  <p>And I want to store each number in an array of ints, and each full-name into an array of strings (a full name would be <code>Joines, William B</code> for example).</p>
  
  <p>What would be the best way, because I debated whether using <code>while (inputFile &gt;&gt; line)</code> or <code>while (getline(inputFile, line))</code> would be better. I don't know if it would be easier to read them one word at a time or read them one line at a time. My main problem will be splitting the <code>97Joines, William B.</code> to <code>97</code> and <code>Joines, William B.</code> which I don't understand how to do in C++.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;fstream&gt;
  using namespace std;
  
  int main() {
      int counter = 0;
      int scores[40];
      string names[10];
      string filename, line;
      ifstream inputFile;
  
  
  cout &lt;&lt; "Please enter the location of the file:\n";
  cin &gt;&gt; filename;
  
  inputFile.open(filename);
  while (inputFile &gt;&gt; line) {
      // if line is numeric values only, do scores[counter] = line;
      // if it is alphabet characters only, do names[counter] = line;
      //if it is both, find a way to split it // &lt;----- need help figuring out how to do this!
  
  }
  inputFile.close();
  </code></pre>
  
  <p>}</p>