Hi, I want to save the value of a variable in a txt file, but when open the file to see the result it is empty
I have the following code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
#if defined(WIN32)
err_averages;
FILE *f_averages
char output_averages[200];
err_averages = fopen_s(&f_averages, output_averages, "w");
double averages[3] = {average_sv, average_svj, average_svcj};
char[50] = "E:\\";
sprintf_s(output_averages, 50, "%s\\results\\averages.txt",mainpath);
for (int s=0; s<3; s++)
{
averages[s];
fprintf(f_averages, "%15.6", average[s]);
fprintf(f_averages,"\n");
}
fclose(f_averages)
|
10x for the help
Last edited on
Well for starters you dont declare a variable at line 7...
Sorry.. it is actually declared... I missed it when I wrothe the code in the forum
It is so:
char mainpath[50] = "E:\\
I do not get compile error
P.S. ...fixed..
Last edited on