title: Getting error C++ no matching function for call even having all constructors
body: <p>I tried to make a BigInt library supporting unit digit initialization and overloading * operator</p>
  
  <p>I am having constructor "BigInt(int r[])" still "return BigInt(res)" is not working, where res in int array</p>
  
  <p>Thank you for you time.</p>
  
  <p>Compiler Error "error: no matching function for call to 'BigInt::BigInt(BigInt)'
           return BigInt(res);"</p>
  
  <p>Here's is the code Iam compiling in Qt Creator</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  class BigInt{
  public:
      int h[1000];
  
      BigInt(){
          for(int i=0; i&lt;1000; i++) h[i] = -1;
      }
      BigInt(int n){
          for(int i=0; i&lt;1000; i++) h[i] = -1;
          h[0] = n;
  
          //Assuming single digit
      }
      BigInt(int r[]){
          for(int i=0; i&lt;1000; i++) h[i] = r[i];
      }
      BigInt(BigInt &amp;b){
          for(int i=0; i&lt;1000; i++) h[i] = b.h[i];
      }
  
      BigInt operator*(int n){
          int carry = 0;
          int res[1000] = {-1};
  
          int *a = &amp;h[0];
          int *b = &amp;res[0];
  
          while(1){
  
              int unitDigit = n*(*a) + carry;
              carry = unitDigit/10;
              unitDigit %= 10;
  
              *b = unitDigit;
              b++;
              a++;
  
              if(*a == -1){
                  break;
              }
  
          }
  
          while(carry){
              int unitDigit = carry % 10;
              *b = unitDigit;
              carry /= 10;
              b++;
          }
  
          return BigInt(res);
      }
  
      friend ostream&amp; operator&lt;&lt;(ostream &amp;out, BigInt &amp;b){
          int i;
          for(i = 999; b.h[i] == -1; i--)
              ;
  
          for(; i&gt;=0; i--){
              out&lt;&lt;b.h[i];
          }
  
          return out;
      }
  };
  
  int main(){
  
      int input;
      cin&gt;&gt;input;
  
      BigInt result(1);
  
      for(int i=2; i&lt;input; i++){
          result = result*i;
      }
  
      cout&lt;&lt;result&lt;&lt;endl;
      return 0;
  }
  </code></pre>