title: Dynamic template arrays
body: <p>I want a template class to contain two template dynamic arrays as member variables. I use also a member function to assign to them values. However I got problem with the code and I do not know the reason (probably the syntax). What is the problem in the following code?</p>
  
  <pre><code>template&lt;typename T&gt;
  class ArrayHolder
   {
  public:
  ArrayHolder();
  void setArrays( T [], T [],int,int);
  
  
  private:
  T *array1;
  T *array2;
  };
  
  
  template&lt;typename T&gt;
  ArrayHolderHolder&lt;T&gt;::setArrays(T firstarray[],T secondarray[] ,int N1, int N2)
  {
  array1 = new T[N1];
  array2 = new T[N2];
  
  
  }
  </code></pre>
  
  <p>After the initialization of the dynamic arrays in setArrays, what is the most effective to copy the arrays from the parameters (firstarray,secondarray) to them?  </p>