title: How to attribute values from matrix pointers in a function
body: <p>I'm creating a code which transposes a matrix through a function. When I run this code however, it prints the original matrix, but it closes without printing the transposed matrix. I'm almost certain the problem is with the attribution inside the transpose function, but I can't understand it. </p>
  
  <pre class="lang-c prettyprint-override"><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  //Here I create a function to transpose the matrix
  //I receive a pointer to a double matrix
  void transpose(double *matrix[][5], int size)
  {
      //I create a second matrix
      double transposed[size][5];
      //I transpose the original matrix into the transposed matrix
      for (int i=0; i&lt;=size-1; i++)
      {
          for (int j=0; j&lt;=4; j++)
          {
              transposed[j][i] = *matrix[i][j];
          }
      }
      //I attribute the values from the transposed matrix to the original matrix
      for (int i=0; i&lt;=size-1; i++)
      {
          for (int j=0; j&lt;=4; j++)
          {
              *matrix[i][j] = transposed[i][j];
          }
      }
  
  }
  
  int main()
  {
      //Here I create a matrix and ask for the user to type its values
      double matrix[5][5];
      for (int i=0; i&lt;=4; i++)
      {
          for (int j=0; j&lt;=4; j++)
          {
              printf("Position [%d][%d]", i+1, j+1);
              scanf("%lf", &amp;matrix[i][j]);
          }
      }
      //I use the function
      //I print the matrix after using the function
      transpose(matrix, 5);
      printf("Transposed:\n");
      for (int i=0; i&lt;=4; i++)
      {
          for (int j=0; j&lt;=4; j++)
          {
              printf("%lf   ", matrix[i][j]);
          }
          printf("\n");
      }
  }
  </code></pre>