title: How to set an array in a class in C++
body: <p>I'd like to store an array of numbers in a private variable of a class using a setter method, but am unsure how to.</p>
  
  <p>The program requires a default constructor, and the other essential methods but for simplicity i've only provided the default constructor.</p>
  
  <pre class="lang-cpp prettyprint-override"><code>class numberList{
  public:
      numberList()
      {
          numberStore = new int[8];
      } // default constructor
  
      void setter() // not sure what goes here
      {
          //not sure what goes here
      }
  
  private:
      int* numberStore;
  };
  
  int main()
  {
      numberList list1;
      list1.setter(1,2,3,4,5,6,7)
  }
  </code></pre>
  
  <p>I'd like for the list1.setter() to take all the values to be put into the array. I think memcpy() could be used here, but am unsure.</p>
  
  <p>I understand there's a concept of operator overloading, but am unsure how utilise this. Any help would be appreciated :-)</p>
  
  <p>EDIT: the assignment requires me not to use standard libraries unfortunately :-(</p>