title: Printing a 2D print function in C
body: <p>I feel that I am extremely close to getting this correct, but I am missing out on a vital point of calling the print function in my main method. I am a bit out of practice so simply a push in the right direction would help. My code is supposed to print out the 2D array in row major fashion, followed by column major fashion.</p>
  
  <pre><code>// ArrayPointer.c
  
  #include &lt;stdio.h&gt;
  #include &lt;math.h&gt;
  
  // a: array pointer, m: # of rows, n: # of columns  
  void printMatrixRowMajor(int *a, int m, int n){
  
      printf("Matrix row major fashion:\n");
  
          int x[3][4];
          a = &amp;(x[0][0]);
  
          for (m=0;m&lt;3;m++){
              for (n=0;n&lt;4;n++){
                  printf("%d ", *(a + (m*4)+n));  
              }
              printf("\n");
          }
  }
  // a: array pointer, m: # of rows, n: # of columns
  void printMatrixColMajor(int *a, int m, int n){ 
      printf("\nMatrix column major fashion:\n");
  
          int x[3][4];
          a = &amp;(x[0][0]);
  
          for (n=0;n&lt;4;n++){
              for (m=0;m&lt;3;m++){
                  printf("%d ", *(a + x[m][n]));
              }
              printf("\n");
          }
  }
  main()
  {
      int row, col;
      int x[3][4], *xptr;
  
      xptr = &amp;(x[0][0]);
      printf("%d", printMatrixRowMajor);
  
  
  }
  </code></pre>