title: C++ how to pass string array in function and assign to a variable?
body: <p>I got this error while coding a simple function. This is my function specification.</p>
  
  <pre><code>string studentName;
  string courseTaken[3];
  void setStudent(string, string[]); 
  
  void Student::setStudent(string n, string a[])
  {
     studentName= n;
     courseTaken = a;
  }
  </code></pre>
  
  <p>This is the error I have gotten:</p>
  
  <blockquote>
    <p>incompatible types in assignment of string* to string [3] on this line courseTaken = a;</p>
  </blockquote>
  
  <p>In my code, I never declared any pointer or char.</p>
  
  <p>I don't quite understand what is going wrong here.</p>