title: No matching function call Strange error
body: <pre><code>    #include&lt;iostream&gt;
      using namespace std;
      const int size=4;
  
      template&lt;class datatype&gt;
      class vector
       {
  
          datatype *v;
  
          public:
              vector()
              {
  
                  v=new datatype[size];
                  for(int i=0;i&lt;size;i++)
                      {
                          v[i]=0;//initilaizing vector
                      }
              }
              vector(datatype *ptr)
              {
                  //v=ptr;
                  for(int i=0;i&lt;size;i++)
                  {
                      v[i]=ptr[i];
                  }
              }
  
              datatype operator*(vector &amp;obj)
              {
                  datatype sum=0;
                  for(int i=0;i&lt;size;i++)
                      {
                          sum+=(this)-&gt;v[i] * obj.v[i];
  
                      }
                      return sum;
              }
  };
  
       int main()
      {
          int x[4]={1,2,9,11};
          int y[4]={4,7,7,4};
  
          vector&lt;int&gt; v1;
          v1(x);//no matching call
          vector&lt;int&gt; v2;
          v2(y);//no matching call
         // v1(x);
         // v2(y);
           int total=v1*v2;
           cout&lt;&lt;"Total of v1*v2="&lt;&lt;total&lt;&lt;endl;
      }    
  </code></pre>
  
  <blockquote>
    <blockquote>
      <p>the constructor which in which i am passing integer array x an y is giving me following error.<br>
      error: no match for call to '(vector) (int [4])'.<br>
      error: no match for call to (vector) (int [4]).there is some problem with assigning array to pointer.<br>
      can anyone correct my code .</p>
    </blockquote>
  </blockquote>