I am very new to programming language and need help urgently. I am running a program which gives me one output file for every 5 min simulation. i have to copy and rename the output file in each step so that they can be used in another program . Any suggestions on how to do it with a single code for 10 runs of continuous simulation ? so far i could manage only this which is like this :
#inlcude<stdio.h>
#include<math.h>
#include<string.h>
FILE *foriginal, *fcopied;
int main()
{
char c2[80];
int i;
foriginal=fopen("100_fe.rpt","r");
while (fgets(line, 80, foriginal) != NULL)
{
fprintf(foutp,"%s",line)if(t2[i]==' ') t2[i]='0';
}
sprintf(c2, "%4i" ,save);
for (i=0;i<4;i++)
strcat("100_fe.rpt",c2);
fcopied=fopen("100_fe.rpt", "w")
return 0;
}
I am not sure if I am going the right way as I am really a beginner in programming world. Please help me out in this matter. thanks.