c - reading a specific column in data file

Viewed 2689

So I created a data file like so:

for(size_t n = ...;...;...){
    //do some stuff
    double mean_value = ...
    double min_value = ...
    double max_value = ...

    FILE *fp = fopen(OUTPUT_FILE,"a+");
    fprintf(fp,"%d %lf %lf %lf\n",n,mean_value, min_value, max_value);
    fclose(fp);
}

And now i want to read the mean_values that I've written...

FILE *fp = fopen(OUTPUT_FILE,"a+");
double *means = malloc(...);
for(size_t i = 0; ...; ...){
    fscanf(fp,"%*d %lf %*lf %*lf\n", &means[i]);
}
//more stuff
fprintf(fp,...);
fclose(fp);

And gcc complains about that:

warning: use of assignment suppression and length modifier together in gnu_scanf format [-Wformat=]

fscanf(fp,"%*d %lf %*lf %*lf\n", &means[i]);

         ^

And I'm not sure what it's trying to tell me, here.

1 Answers
Related