title: reading from file and storing into array C++
body: <p>I need to write a function that reads from a file and store the values into parallel arrays. In the text file I have a name and on the next line I have a set of 4 scores. Any tips on how to achieve this. 
  here is an example of the text file</p>
  
  <pre><code>joe
  30 75 90 88
  ben 
  100 75 93 20
  </code></pre>
  
  <p>now here is the code I have so far</p>
  
  <pre><code>ifstream input;
  
  int main()
   {
  string nameArray[];
  double grades[];
  void nameGrade(string[], double[]);
  
  input.open("scores.txt");
  
  nameGrade(nameArray, grades);
  
  for (int i = 0; i &lt;4; i++)
  {
      cout &lt;&lt; "student name: " &lt;&lt; nameArray[i] &lt;&lt; " Student Grades: " &lt;&lt; grades[i] &lt;&lt; endl;
  }
  input.close();
  return 0;
  }
  
  void nameGrade(string name[], double grade[])
  {
      for (int i = 0; i &lt; 5; i++)
      {
          getline(input,studentName[i]);
          input &gt;&gt; studentGrade[i];
      }
  }
  </code></pre>