title: Compiling Errors with Arrays and 'struct'?
body: <p>I'm just about at the end of my first programming class, (first programming class) and I require assistance with my code, seeing as how I am getting unclear compiling errors.</p>
  
  <p>First of all, there is the fact that the array I am attempting to load is giving me problems. </p>
  
  <pre><code>string stu[15];
  stu[0]= Billy;
  stu[1]= Bobby;
  stu[2]= Bailee;
  stu[3]= Barney;
  stu[4]= Bambi;
  stu[5]= Barbie;
  stu[6]= Barrie;
  stu[7]= Barry;
  stu[8]= Benny;
  stu[9]= Barkley;
  stu[10]= Bennie;
  stu[11]= Bonnie;
  stu[12]= Bernie;
  stu[13]= Bertie;
  stu[14]= George;
  </code></pre>
  
  <p>Apparently it says every one of those are undeclared. But I thought that was almost the point of arrays? To not spend all your time declaring variables?</p>
  
  <p>My other problem is with this code...</p>
  
  <pre><code>int name_count = 0;
  
  while (name_count &lt; 15) 
  { 
      inputFile &gt;&gt; (stu[0]); 
      if (!inputFile.good()) break; 
      ++name_count; 
  }
  </code></pre>
  
  <p>I'm trying to load in data from a <code>.txt</code> file into an array, and I'm confused on how to do this.</p>
  
  <p>All code together:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;cmath&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  int main() {
      string inputFile;
      string stu[15];
      stu[0] = Billy;
      stu[1] = Bobby;
      stu[2] = Bailee;
      stu[3] = Barney;
      stu[4] = Bambi;
      stu[5] = Barbie;
      stu[6] = Barrie;
      stu[7] = Barry;
      stu[8] = Benny;
      stu[9] = Barkley;
      stu[10] = Bennie;
      stu[11] = Bonnie;
      stu[12] = Bernie;
      stu[13] = Bertie;
      stu[14] = George;
  
      ofstream(studentFile)("Students.txt");
      studentFile.open("Students.txt");
  
      studentFile &lt;&lt; " STUDENT INFO HERE ";
      studentFile.close();
  
      int name_count = 0;
  
      while (name_count &lt; 15) {
          inputFile &gt;&gt; (stu[0]);
          if (!inputFile.good())
              break;
          ++name_count;
      }
  
      system("pause");
      return 0;
  }
  </code></pre>
  
  <p>I keep getting the compiling errors:</p>
  
  <blockquote>
    <p>no match for 'operator>>' in 'inputFile >> stu[0]' </p>
  </blockquote>
  
  <p>and </p>
  
  <blockquote>
    <p>'struct std::string' has no member named 'good' </p>
  </blockquote>
  
  <p>Pretty sure I'm missing something here...any help woudld be greatly appreciated. Thank you so much.</p>