I have been working on this program since the start of May. It was a converter to convert a form of data to another form of data for simulation of some kind. Actually, this program is suppose to be finished, as I have run testing on it and it works great. However, my boss wants me to change the converter to read infinite (or alot) number of lines of data instead of 260 lines that I have set statically from the start. So what I need to do is to establish a dynamic memory location array that gives me the ability to allocate memory for data by determining the number of lines in the text file. Then after allocation, i want to initialize all elements of the strct to either NULL or 0 (hence the function that I am showing is caklled initializing structs).
Here is the function and the struct:
Code:
struct database_input {
  char* A;
  int B;
  double C;
  int D;
};




void initializing_structs(struct database_input *data, FILE *InputConnectionFile)
{
  FILE *ifp = InputConnectionFile;
  char cat_A[260];
  char cat_B[1];
  char cat_C[260];
  int cat_D;
  int cat_E;
  int i = 0;
  int j = 0;	
  while(!feof(stdin) && !ferror(stdin))
    {
      fscanf(ifp, "%s", cat_A);
      fscanf( ifp, "%s %s %d %d",  cat_B, cat_C, &cat_D, &cat_E);
      i++;
    }
  
  *data = (struct database_input *) malloc(i * sizeof(struct database_input));
  while(j< i)
    {
      data[j].B = 0;
      data[j].C = 0;
      data[j].D = 0;
      j++;
    }
}
however, when i compile my program, an error message pops up:
finprojectmain.c: In function `initializing_structs':
finprojectmain.c:168: error: incompatible types in assignment
which line 168 refers to the line with malloc. Can somebody give me a hint in how to fix this problem?

Thanks