The fprintf inserts the sum/200 later than it is supposed to and part of the original file disappears. I imagine that it has to with timing of the various steps. Any way I can make this work?
Thanks
Thanks
Code:
for(l = 0; l < numstocks; l++)
{
rewind(stocks[l]);
sum = 0;
for (i = 0; i < 200; i ++)
{
k = fscanf(stocks[l],"%s %f ", date, price[i]);
sum += *price[i];
}
fprintf(stocks[l]," %6.3f\n", sum/200);
}