title: How to compare two 2d arrays of char in C/ C++
body: <p>I am passing two 2d arrays of char into a function, that will return 1 if the arrays are equal and 0 otherwise.
  size of the arrays is [4][4], However when I try to iterate through the array I get an error.</p>
  
  <pre><code>int checkIfWin(char** array, char** array2){
  
  int winner = 0;
  
  for(int i = 0; i &lt; 4; i++){
  
      if(strcmp(array2[i], array[i])==0){
          winner = 1;
      }
      else
          winner = 0;
  
  }
  return winner;
  
  }
  </code></pre>
  
  <p>UPDATE:</p>
  
  <p>The reason why I was getting an errorn while strcmp is because I did not malloc the second 2d array.</p>