title: Store Input from Text File into Arrays or Variables?
body: <blockquote>
    <p>My Problem:</p>
  </blockquote>
  
  <p>I am very new to new to programming and trying to write a program in C++,  I have a text file. <strong>*In the text file is stored is a Students Name, Grade, and Grade Letter. I want them stored as different types in arrays *</strong></p>
  
  <p>I want to store them individually in an array.... 
  ie text file would look like this: </p>
  
  <pre><code>Jill Hamming A 96  
  Steven Jenning A 94  
  Tim Sutton B 89  
  Dillon Crass C 76   
  Sammy Salsa D  54  
  Karen Poulk D 49  
  </code></pre>
  
  <p>I would like to store all the First names in one array, last names in another etc. So on and so on. 
  These arrays will later be assigned to object for the student. There maybe up to 500 students. </p>
  
  <p>So the question:</p>
  
  <p><strong>How to store input from a text document into an array instead of using 500 variables.</strong> </p>
  
  <p>ie. Here is my attempt.</p>
  
  <pre><code>int main()
  {
   /// the input is all different types, strings, ints and chars
   string my_First_Name[500], my_Last_Name[500];
   int my_grade[500]; 
   char my_letter[500]; 
  
   ifstream myfile("input.txt");
   if (myfile.is_open()){
  
          for (int i = 0; i &lt; 500; i++) {
          myfile &gt;&gt; my_First_Name[i] &gt;&gt; my_Last_Name[i] &gt;&gt; my_grade[i] &gt;&gt;         my_letter[i]; 
  
  
           }
        // much later and irrelevent part but just showing because this is what I want to do. where Student Class exsists somewhere else. yet to be programmed. 
       Student myStudent [500];
       myStudent[i].Grades = my_grade[i];
       myStudent[i].LetterGrade = my_letter[i];
    }
   myfile.close();
  //Exit 
  system("pause");
  return 0;
  
  }
  </code></pre>
  
  <p>When I went to print out what I had. I had all negative and weird numbers which means it was not initialized. Where did I go wrong?</p>