title: How to structure a function with a file and a malloc
body: <p>If a I have a function that works with a file and a pointer, like this:</p>
  
  <pre><code>int funzione (int *vet)
  {
      FILE *fin;
  
      if ( !(fin = fopen(name, "r")) )
          return 1;
  
      /* read informations from file (like num) */
  
      vet = (int *) malloc (num*sizeof(int));
  
      /* ... */
  
      return fclose(fin); 
  }
  </code></pre>
  
  <p>How can I return <code>vet</code>?
  Thank you.</p>