title: How do I write setters and getters for an array? (c++)
body: <p>Im writing a class within c++, however I am not certain on how to create the setters and getters for the arrays (sorry for it being a basic question!) I am getting the following error: </p>
  
  <p>expected primary expression before ']' token</p>
  
  <p>Here is my code: </p>
  
  <pre><code>Class planet: public body
  {
  private:
    string name[];
    string star[];
  public:
    void nameSetter (string h_name[])
    {
        name[] = h_name[];
    }
  };
  </code></pre>
  
  <p>Once again I am sorry for such I silly question, I know I am not passing an index through, however, when I create an index it throws up a large amount of errors!</p>