title: Read a matrix from a file
body: <p>This is my function to read a matrix from a file. In the text file I have on the first line 2 is <code>n</code> and  3 is <code>m</code> and  on the next two lines is the matrix. 
  I don't have erros, but my program "stop working" and I don't know why. Thank you!
  In main I have: <code>readmatrix(n,m,a, "text.txt");</code></p>
  
  <pre><code>int readmatrix(int* n,int *m, int a[*n][*m], char* filename){
      FILE *pf;
      int i,j;
      pf = fopen (filename, "rt");
      if (pf == NULL)
      return 0;
      fscanf (pf, "%d",n); 
      for (i=0;i&lt;*n;i++) 
      {
          for(j=0;j&lt;*m;j++)
          fscanf (pf, "%d", &amp;a[i][j]);
      }
      fclose (pf); 
      return 1; 
      }
  </code></pre>