title: How to read data from a file and store the names from the file in one vector, and the scores from the file in another?
body: <p>My prompt asks:
  In this program, we are going to input the name and score of 100 students from a file named
  student.txt. This file has been provided to you. You have to use two vector variables, one to store the
  student names, and another to store the student scores.</p>
  
  <p>The text file referred to is formatted like:</p>
  
  <p>James 80</p>
  
  <p>Frank 67</p>
  
  <p>Jenny 95</p>
  
  <p>I'm struggling to understand how to read and store two variables from one file into two vectors, so if what I have so far doesn't make sense, I won't be totally shocked.  There is an error message at my >> after infile saying there are no operators that match those operands and I have no idea what to do about that.  Further, I just don't know where to go from here, or how to fix my current code. Any help is appreciated.  Please be patient with me, I'm super new to this.</p>
  
  <pre><code>//Name
  //This program will read and sort names and grades from a file using functions and vectors
  #include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;string&gt;
  #include &lt;iomanip&gt;
  #include &lt;vector&gt;
  using namespace std;
  
  int main()
  {
      ifstream infile;
      infile.open("student.txt");
  
      if (infile.fail() == false)
      {
          vector&lt;string&gt; name;
          vector&lt;int&gt; score;
  
          while (infile &gt;&gt; name)
          {
              infile &gt;&gt; score;
          }
      }
      else
      {
          cout &lt;&lt; "Could not open the file." &lt;&lt; endl;
      }
  return 0;
  }
  
  </code></pre>