title: C - cannot read and process a list of strings from a text file into an array
body: <p>This code reads a text file line by line. But I need to put those lines in an array but I wasn't able to do it. Now I am getting a array of numbers somehow.  So how to read the file into a list. I tried using 2 dimensional list but this doesn't work as well.</p>
  
  <p>I am new to C.  I am mostly using Python but now I want to check if C is faster or not for a task.</p>
  
  <pre class="lang-c prettyprint-override"><code>#include &lt;stdio.h&gt;
  #include &lt;time.h&gt;
  #include &lt;string.h&gt;
  
  
  void loadlist(char *ptext) {
  
     char filename[] = "Z://list.txt";
     char myline[200];
     FILE * pfile;
     pfile = fopen (filename, "r" );
  
     char larray[100000];
     int i = 0;
     while (!feof(pfile)) {
         fgets(myline,200,pfile);
         larray[i]= myline;
         //strcpy(larray[i],myline);
         i++;
         //printf(myline);
  
     }
  
  
     fclose(pfile);
     printf("%s \n %d \n  %d \n ","while doneqa",i,strlen(larray));   
     printf("First larray element is: %d \n",larray[0]);
  
      /* for loop execution */
     //for( i = 10; i &lt; 20; i = i + 1 ){
     //   printf(larray[i]);
     //}
  
  
      }
  
  
  int main ()
  {
     time_t stime, etime;
     printf("Starting of the program...\n");
     time(&amp;stime);
  
     char *ptext = "String";  
     loadlist(ptext);
     time(&amp;etime);
  
     printf("time to load: %f \n", difftime(etime, stime));
  
     return(0);
  }
  </code></pre>
  
  <p>This code reads a text file line by line. But I need to put those lines in an array but I wasn't able to do it. Now I am getting an array of numbers somehow.</p>