title: C++, how to declare a struct in a header file
body: <p>I've been trying to include a structure called "student" in a <code>student.h</code> file, but I'm not quite sure how to do it.</p>
  
  <p>My <code>student.h</code> file code consists of entirely:</p>
  
  <pre><code>#include&lt;string&gt;
  using namespace std;
  
  struct Student;
  </code></pre>
  
  <p>while the <code>student.cpp</code> file consists of entirely:</p>
  
  <pre><code>#include&lt;string&gt;
  using namespace std;
  
  struct Student {
      string lastName, firstName;
      //long list of other strings... just strings though
  };
  </code></pre>
  
  <p>Unfortunately, files that use <code>#include "student.h"</code> come up with numerous errors like </p>
  
  <pre><code>error C2027: use of undefined type 'Student'
  
  error C2079: 'newStudent' uses undefined struct 'Student'  (where newStudent is a function with a `Student` parameter)
  
  error C2228: left of '.lastName' must have class/struct/union 
  </code></pre>
  
  <p>It appears the compiler (VC++) does not recognize struct Student from "student.h"?</p>
  
  <p>How can I declare struct Student in "student.h" so that I can just #include "student.h" and start using the struct?</p>