title: Passing 2d arrays without knowing the size?
body: <p>Can anyone help me? I want to pass firstMatrix, secondMatrix, and finalMatrix. So far I have this. I could make it a global variable but I still wouldnt know the actual size</p>
  
  <pre><code>int matrixSummation(int firstMatrix[][matrixSize],int secondMatrix[][matrixSize], int finalMatrix[][matrixSize], int matrixSize){
  for(int row=0; row&lt; matrixSize; row++){
      for(int col=0; col&lt; matrixSize; col++){
          finalMatrix[row][col]=firstMatrix[row][col]+secondMatrix[row][col];
      }
  }
  }
    int main(int argc, char** argv) {
  
  
  int matrixSize;
  
  cout &lt;&lt; "Enter size of your matrices: " &lt;&lt;endl;
  cin &gt;&gt; matrixSize;
  
  int firstMatrix[matrixSize][matrixSize];
  int secondMatrix[matrixSize][matrixSize];
  int finalMatrix[matrixSize][matrixSize];
  
  cout &lt;&lt;"Enter numbers for the 1st matrix: "&lt;&lt;endl;
  for(int row = 0; row &lt; matrixSize; row++){
      for(int col=0; col&lt; matrixSize; col++){
          cin &gt;&gt; firstMatrix[row][col];
      }
  }
  
  cout &lt;&lt;"Enter your numbers for the 2nd matrix: "&lt;&lt;endl;
  for(int row = 0; row &lt; matrixSize; row++){
      for(int col=0; col&lt; matrixSize; col++){
          cin &gt;&gt; secondMatrix[row][col];
      }
  }
  matrixSummation(firstMatrix,secondMatrix,finalMatrix,matrixSize);
  }
  </code></pre>