title: error: cannot convert ‘char*’ to ‘int*’ in assignment (also for 'double*' to 'int*')
body: <p>My lab assignment is to create a template class for instantiating arrays of different data types. However, when I call the either my 'default' or 'new' constructor for the template as a data-type other than INT, I receive the following error:</p>
  
  <pre><code>Template.h: In constructor ‘Template&lt;T&gt;::Template() [with T = char]’:
  main.cc:52:20:   instantiated from here
  Template.h:71:5: error: cannot convert ‘char*’ to ‘int*’ in assignment
  Template.h: In constructor ‘Template&lt;T&gt;::Template(int) [with T = char]’:
  main.cc:58:35:   instantiated from here
  Template.h:89:5: error: cannot convert ‘char*’ to ‘int*’ in assignment
  Template.h: In constructor ‘Template&lt;T&gt;::Template(int) [with T = double]’:
  main.cc:72:36:   instantiated from here
  Template.h:89:5: error: cannot convert ‘double*’ to ‘int*’ in assignment
  Template.h: In copy constructor ‘Template&lt;T&gt;::Template(const Template&lt;T&gt;&amp;) [with T = double]’:
  main.cc:73:35:   instantiated from here
  Template.h:101:5: error: cannot convert ‘double*’ to ‘int*’ in assignment
  </code></pre>
  
  <p>Header file: (truncated after constructor definitions, will post if necessary to answer my question)</p>
  
  <pre><code>#ifndef TEMPLATE_H
  #define TEMPLATE_H
  #include &lt;iostream&gt;    
  using namespace std;
  
  template &lt;typename T&gt;
  class Template {
      friend istream &amp; operator&gt;&gt;( istream &amp; in, Template&lt;T&gt; &amp; a ) {
         a.input();
         return in;
      }
      friend ostream &amp; operator&lt;&lt;( ostream &amp; out, const Template&lt;T&gt; &amp; a ) {
         a.output();
         return out;
      }
  public:
      Template&lt;T&gt; ();   // Default constructor
      Template&lt;T&gt; ( int );   // New constructor
      Template&lt;T&gt; ( const Template&lt;T&gt; &amp; );   // Copy constructor
      ~Template&lt;T&gt; ();   // Destructor.
  
      // Operator overload prototypes.
      const Template&lt;T&gt; &amp; operator=( const Template&lt;T&gt; &amp; );
      const bool operator==( const Template&lt;T&gt; &amp; );
      const bool operator!=( const Template&lt;T&gt; &amp; );
  
      T &amp; operator[]( int );  // Left hand operator.
      T operator[]( int ) const;  // Right hand operator.
  private:
      // Member function prototypes
      bool isEqual ( const Template&lt;T&gt; &amp; );
      void input();
      void output() const;
  
      static const int DEFAULTSIZE = 10; // Set default array size.
      static const int MAXSIZE = 100; // Set maximum array size.
      static T DEFAULTVALUE; // Set value of array elements.
      int size;
      int * ptr;
  };    #endif
  
  template &lt;typename T&gt;
  T Template&lt;T&gt;::DEFAULTVALUE; // Instantiate DEFAULTVALUE of ADT T
  
  /****************************Constructors*****************************/
  
  // Default constructor
  template &lt;typename T&gt;
  Template&lt;T&gt;::Template() {
      size = DEFAULTSIZE;
      ptr = new T [size];     // Allocate memory for array[DEFAULTSIZE].
      for (int i = 0; i &lt; size; i++) 
          ptr[i] = DEFAULTVALUE;  // Set all elements to DEFAULTVALUE.
  }
  
  // New constructor
  template &lt;typename T&gt;
  Template&lt;T&gt;::Template( int a ) {
      if (a &lt; 1)
          size = DEFAULTSIZE; // Can't allocate array of &lt;= 0 elements.
      else if (a &gt; MAXSIZE)
          size = MAXSIZE; // Template can be no larger than 100 elements.
      else
          size = a;   // Valid argument, passed to size.
  
      ptr = new T [size];
      for (int i = 0; i &lt; size; i++) 
          ptr[i] = DEFAULTVALUE;  // Set all elements to DEFAULTVALUE.
  }
  
  // Copy constructor
  template &lt;typename T&gt;
  Template&lt;T&gt;::Template( const Template&lt;T&gt; &amp; b ) {
      size = b.size;
      ptr = new T [size]; // Set size to argument's array size.
      for (int i = 0; i &lt; size; i++)
          ptr[i] = b.ptr[i]; // Copy elements.
  }
  
  // Destructor
  template &lt;typename T&gt;
  Template&lt;T&gt;::~Template () {
      for (int i = 0; i &lt; size; i++) {
          delete ptr; // Deallocate memory.
          ptr = NULL; // Delete array elements.
      }
  }
  </code></pre>
  
  <p>Relevant part of main.cc file: (beginning at line 52)</p>
  
  <pre><code>    Template&lt;char&gt; charOne; // Default constructor called for charOne
  
      cout &lt;&lt; "Now specify size of array charOne: ";
      cin &gt;&gt; arrSize;
      cout &lt;&lt; endl;
  
      Template&lt;char&gt; charTwo(arrSize); // New constructor call
  
      // Print contents of both arrays.
      cout &lt;&lt; "Printing contents of both arrays:\n" &lt;&lt; "charOne: " 
           &lt;&lt; charOne &lt;&lt; "charTwo: " &lt;&lt; charTwo;
  
      // Check equality of charOne &amp; charTwo.
      if (charOne == charTwo)
          cout &lt;&lt; "charOne == charTwo.\n" &lt;&lt; endl;
      else 
          cout &lt;&lt; "charOne != charTwo.\n" &lt;&lt; endl;
  
  /**************************Double Template***************************/
  
      Template&lt;double&gt; dblOne(arrSize);
      Template&lt;double&gt; dblTwo(dblOne);
  </code></pre>