title: How to use sizeof in the void function for determine size of 2d matrix?
body: <pre><code>#include&lt;stdio.h&gt;   
  #include&lt;stdlib.h&gt;
  #include&lt;string.h&gt;
  
  void find_col_num(int matrix[][5])
  {
      printf("size of matrix = %d\n",sizeof(matrix));
      printf("size of one element = %d\n", sizeof(matrix[0][0]));
      printf("number of columns = %d\n", sizeof(matrix)/(sizeof(matrix[0][0])*5));
  }
  
  int main()
  {
      int a[6][5] = { {0,0,0,0,0},
                      {0,1,1,1,1},
                      {1,0,1,0,0},
                      {1,0,1,0,0},
                      {1,0,1,0,0},
                      {0,1,1,1,1} };
  
      find_col_num(a);
  
      printf("\n\n\n");
  
      printf("size of a = %d\n",sizeof(a));
      printf("size of one element = %d\n", sizeof(a[0][0]));
      printf("number of columns = %d\n", sizeof(a)/(sizeof(a[0][0])*5));
  
      return 0;
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>size of matrix = 8
  size of one element = 4
  number of columns = 0
  
  
  
  size of a = 120
  size of one element = 4
  number of columns = 6
  </code></pre>
  
  <p>I want to use <code>sizeof</code> in the void or int function for determine number of the matrix's column. I know that I have to specify number of the matrix's line in the function. How can I handle that?</p>