title: Passing 2D arrays in C like argv of main
body: <p>I am learning passing 2D arrays to functions in C and learned that I can receive 2D array in the function as following:</p>
  
  <ol>
  <li><code>void test(char a[5][10])</code></li>
  <li><code>void test(char (*a)[10])</code></li>
  </ol>
  
  <p>Above declarations work for me but looking on <code>**argv</code> parameter of function main I thought of changing my function to <code>void test(char **a)</code>. But this does not work correctly. I do not understand why. Please explain.</p>
  
  <p>Here is my code</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  
  int main(int argc, char **argv){
      char multi[5][10] = {
                           {'0','0','2','3','4','5','6','7','1','9'},
                           {'a','b','c','d','e','f','g','h','i','j'},
                           {'A','B','C','D','E','F','G','H','I','J'},
                           {'9','8','7','6','5','4','3','2','1','0'}, 
                           {'J','I','H','G','F','E','D','C','B','A'}
                          };
      test(multi);
      return 0;
  }
  
  void test(char (*a)[10]) // void test(char **a) does not work
  {
      printf("\n a[2][1] is: %d",*(*(a + 2)+1));
  }
  </code></pre>