title: Having issues with a function returning a file pointer
body: <p>I was hoping to get a hand a function and call to take in a text file as input use dynamic memory allocation and then return a file pointer, I am not getting any errors currently but I am not understanding how to return the full multiline pointer</p>
  <pre><code>    char * readFile ( char * filename){
      char text[5][100];
      int i=0;
      char ** input=NULL;
      input=malloc(sizeof(char*));
      FILE *fptr;
      fptr=fopen(filename,&quot;r&quot;);
      while(!feof(fptr)){
      fgets(text[i],1000,fptr);
      i++;
      }
      fclose(fptr);
      for (int j = 0; j&lt;i; j++){
      input[j]=malloc(sizeof(char)*strlen(text[j])+1);
      strcpy(input[j],text[j]);
      }
  
      for (int a = 0; a &lt; i; a++){
      printf(&quot;%s&quot;,input[a]);
      }
      return *input;
      }
  
  </code></pre>
  <p>The call was just:</p>
  <pre><code>printf(&quot;%s&quot;, readFile(&quot;test1.txt&quot;));
  </code></pre>