title: read data from file into array of structures
body: <p>Hi I'm trying to read data from file into array of structures I tried to use fgets but got the error saying that RECORD type cannot be convert to char* this is what i have so far</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  #define MAX_NAME   20
  #define FILE_NAME  50
  #define LIST_SIZE 50
  //void getData(RECORD name[], RECORD score)
  
  
  typedef struct RECORD
  {
      char *name;
      float  score;
  }RECORD;
  
  
  int main (void)
  {
      // Declarations
         FILE *fp;
         char fileName[FILE_NAME];
         RECORD list[LIST_SIZE];
         int count = 0;
      // Statements
         printf("Enter the file name: ");
         gets(fileName);
  
         fp = fopen(fileName, "r");
  
         if(fp == NULL)
             printf("Error cannot open the file!\n");
           while (fgets(list[count], LIST_SIZE, fp) != NULL)
           {
               count++;
           }
         return 0;
  }
  </code></pre>
  
  <p>the error occurs in the fgets statement inside while loop, how can i fix this and read data into array of structures?</p>
  
  <p>thank in advance</p>