title: Error sum of two matrix in function By using 2d array
body: <pre><code>    #include &lt;iostream&gt;
     using namespace std;
  int add(int x[3][3], int y[3][3],int z[3][3]);
  
  int main()
  {
   int x[3][3],y[3][3],z[3][3];
      cout&lt;&lt;&quot;Enter value for x &quot;&lt;&lt;endl;
      for(int i=0;i&lt;3;i++)
      {
          for(int j=0;j&lt;3;j++)
          {
          
          cout&lt;&lt;&quot;Enter the value of index &quot;&lt;&lt;i&lt;&lt;&quot;,&quot;&lt;&lt;j&lt;&lt;&quot; :&quot;;
          cin&gt;&gt;x[i][j];
          }
          
      }
      cout&lt;&lt;&quot;Enter value for y &quot;&lt;&lt;endl;
      for(int i=0;i&lt;3;i++)
      {
          for(int j=0;j&lt;3;j++)
          {
          
          cout&lt;&lt;&quot;Enter the value of index &quot;&lt;&lt;i&lt;&lt;&quot;,&quot;&lt;&lt;j&lt;&lt;&quot; :&quot;;
          cin&gt;&gt;y[i][j];
          }
          
      }
      
      cout&lt;&lt;&quot;Your result is :&quot;;   
      for(int i=0;i&lt;3;i++)
      {
          for(int j=0;j&lt;3;j++)
          {
          
          cout&lt;&lt;add(x[3][3],y[3][3]);
          }
          cout&lt;&lt;endl;
          
      }
      return 0;}
  int add(int x[3][3], int y[3][3],int z[3][3])
  {
  for(int i=0;i&lt;3;i++)
  {
      for(int j=0;j&lt;3;j++)
      {
          z[i][j]=x[i][j]+y[i][j];
      }
  }
  for(int i=0;i&lt;3;i++)
  {
      for(int j=0;j&lt;3;j++)
      {
         cout&lt;&lt;z[i][j];
      }
      cout&lt;&lt;endl;
  }
  }
  </code></pre>
  <p>=================================================================================
  you See the program in which I am want to add 2 matrix by using 2d array and I am also use Function <code>add(int x[3][3], int y[3][3],int z[3][3])</code> .  In this program One thing will give me error when i am try to compile it that  are <code>cout&lt;&lt;add(x[3][3],y[3][3])</code>  compiler say you have store three values in Function so write three values like <code>add(int x[3][3], int y[3][3],int z[3][3])</code> but WE know that at this piont we write only two integer that I am want to add that are declared in Function <code>z[i][j]=x[i][j]+y[i][j]</code>. So that program cannot be execute from me. So that why I am want your correction in this program .</p>