title: Compile Error: 2 overloads have no legal conversion for 'this' pointer. Working with structs
body: <p>My programming assignment wants me define a structure Student with a name vector, and a structure Course with a name and a vector  that contains enrolled students and the following functions:</p>
  
  <pre><code>void print_student(Student* s)
  void print_course(Course* c)
  void enroll(Student* s, Course* c)
  //enrolls given student in the given course and updates both vectors
  </code></pre>
  
  <p>I tried adding ampersands within the enroll function parameters to fix it, but it didn't work.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;vector&gt;
  
  using namespace std;
  
  struct Student 
  {
      string Name ;
      vector &lt; Course* &gt; Courses;
  };
  
  struct Course 
  {
      string Name ;
      vector &lt; Student* &gt; Students;
  };
  
  void print_Student(Student* s)
  {
      cout &lt;&lt; s-&gt;Name &lt;&lt; endl;
      for (int i = 0; i &lt; s-&gt;Courses.size(); i++)
      {
          cout &lt;&lt; s-&gt;Courses[i] &lt;&lt; endl;
      }
  };
  
  void print_course(Course* c)
  {
      cout &lt;&lt; c-&gt;Name &lt;&lt; endl;
  
      for (int i = 0; i &lt; c-&gt;Students.size(); i++)
      {
          cout &lt;&lt; c-&gt;Students[i] &lt;&lt; endl;
      }
  };
  
  void enroll(Student* &amp;s, Course* &amp;c)
  {
      cout &lt;&lt; "Enrolled " &lt;&lt; s &lt;&lt; "in " &lt;&lt; c &lt;&lt; endl;
      s-&gt;Courses.push_back( c ); 
      c-&gt;Students.push_back( s);
  }
  
  
  int main()
  {
      Student* Bob;
      Course* ComputerScience;
  
      Bob-&gt;Name = "Bob";
  
      ComputerScience-&gt;Name = "Computer Science";
  
      enroll( Bob , ComputerScience);
  
      system("Pause");
  }
  </code></pre>
  
  <p>I expected the code to enroll the student Bob to the Computer Science course so I can later define more students and print them.</p>
  
  <p>The code seems good but,when running the compiler gives me the following errors:</p>
  
  <pre><code>source.cpp(10): error C2065: 'Course': undeclared identifier
  source.cpp(10): error C2059: syntax error: '&gt;'
  source.cpp(10): error C2976: 'std::vector': too few template arguments
  source.cpp(41): error C2663: 'std::vector&lt;_Ty,_Alloc&gt;::push_back': 2 overloads have no legal conversion for 'this' pointer
  </code></pre>
  
  <p>I'm confused on what's going on, and how could I fix it?</p>