title: Error passing argument1 of 'fprintf' from incompatible pointer type. C
body: <p>here is what i have so far. The only building issue is line 95, the last line of code. I'm trying to count the lines in a file, then build arrays from the data and display arrays of max and min values form user inputs.  </p>
  
  <pre><code>#include "stdio.h"
  #include "stdlib.h"
  
  
  
  struct earthquake_t
  { 
      float lat;
      float lng;
      float dep;
      float mag;
  };
  
  FILE* fid;
  
  int main(void)
  {
      double lat,lng, dep,mag;
      double userminlat,userminlng,usermaxlat,usermaxlng,minlat,minlng,maxlat,maxlng,                      ch,line,count
      struct earthquake_t *earthquake;
      int i;
  
  
      fid=fopen("day.txt","r");
  
      while (!feof(fid))
      {
  
           line = fscanf(fid,"%lf, %lf, %lf, %lf\n",&amp;lng,&amp;lat,&amp;dep,&amp;mag);
           count = fscanf(fid," %lf %lf %lf %lf\n",&amp;lng,&amp;lat,&amp;dep,&amp;mag);
  
  
          if (count ==4)
          {
               line ++;
          }
      }
  
      fseek(fid,1,SEEK_SET);
      printf("%d\n",sizeof(struct earthquake_t));          
      earthquake = (struct earthquake_t *)malloc(sizeof(struct earthquake_t)*line);
  
      for (i=0;i&lt;line;i++)
      {          
          sscanf("fid", "%lf %lf %lf %lf\n",&amp;lng,&amp;lat,&amp;dep,&amp;mag,
          earthquake[i].lat,
          earthquake[i].lng,
          earthquake[i].dep,
          earthquake[i].mag);
  
          if(earthquake[i].lng &gt;maxlng) 
          {     
              maxlng = earthquake[i].lng;
          }
          if(earthquake[i].lng &gt;minlng)
          {    
              minlng = earthquake[i].lng;
          }
          if(earthquake[i].lat &gt;maxlat)
          {
              maxlat = earthquake[i].lat;
          }
          if(earthquake[i].lat &gt;minlat)
          {
  
          minlat = earthquake[i].lat;
          }
  
      } 
  
  
  
      printf("Longitude is between %f and %f\n",minlng,maxlng);
      printf("Latitude is between %f and %f\n\n",minlat,maxlat);
      printf("Give a value for min longitude: ");
      scanf("%d",userminlng);
      printf("Give a value for max longitude: ");
      scanf("%d",usermaxlng);
      printf("Give a value for min latitude: ");
      scanf("%d",userminlat);
      printf("Give a value for max latitude: ");
      scanf("%d",usermaxlat);
  
  
      FILE *fid2;
      fid2=fopen("subset.txt","w");
  
      for (i=0;i&lt;line;i++)
      {     
          if((earthquake[i].lng &gt; userminlng) &amp;&amp; (earthquake[i].lng &lt; usermaxlng))
          {    
              if((earthquake[i].lat &gt; userminlat) &amp;&amp; (earthquake[i].lat &lt; userminlat))
              {
                  fprintf( "subset.txt" ,"%f,%f,%f,%f \n", earthquake[i].lat,              earthquake[i].lng, earthquake[i].dep, earthquake[i].mag); //error
  
              }
          }
      }
  }
  </code></pre>