title: What is the correct way of defining the class constructor?
body: <p>I am trying to multiply two matrices by passing to the class which will do multiplication. I am facing the problem while defining the constructor please help me with this..(errror is shown below)</p>
  
  <p>My header file is MatMul.h as :</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;iostream&gt;
  
  using namespace std;
  
  class MatMul
  {
      double **C;
      int row,col,common;
  public:
  
      MatMul(int p,int q,int r)
      {
          row=p; col=q,common=r;
          C=new double *[row];
          for(int i=0;i&lt;row;i++)
              C[row]=new double [col];
      }
  
      void multiply(double A[][3],double B[][3],int p,int q,int r)
      {
          for (int i=0;i&lt;row;i++)
          {
              for (int j=0;j&lt;col;j++)
              {
                  C[i][j]=0;
                  for(int k=0;k&lt;r;k++)
                  {
                      C[i][j]=C[i][j]+A[i][k]*B[k][j];
                  }
              }
          }
      }
  };
  </code></pre>
  
  <p>and the maincpp file is </p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;iostream&gt;
  using namespace std;
  #include"MatMul.h"
  
  int main()
  {
      int p=3,q=3,r=3;
      double A[p][r]={{1,0,0},{0,1,0},{0,0,1}};
      double B[r][q]={{1,0,0},{0,1,0},{0,0,1}};
      MatMul c(p,q,r);
      c.multiply(A,B,p,q,r);
  
      return 0;
  }
  </code></pre>
  
  <p>It is showing   </p>
  
  <pre><code>error: no matching function for call to ‘MatMul::multiply(double [p][r], double [r][q], int&amp;, int&amp;, int&amp;)’
  </code></pre>
  
  <p>Please can you identify the error and update it.</p>