static void UpdateHistoryFile(void)
{
FILE *fin,*fout;
int counter = 1;
STest test;
do
fin=fopen("test.txt","r");
fout=fopen("t.tmp","w");
while(readHistoryFile(fin, &test) != EOF)
if (test.b == 20160516) // to add the judgement case.
printf("test.b < 20160516\n");
}
else
test.a = counter;
writeHistoryFile(fout, test);
counter++;
fclose(fin);
fclose(fout);
remove("test.txt");
rename("t.tmp","test.txt");
}while(0);
return;
static void UpdateHistoryFile(void)
{
FILE *fin,*fout;
int counter = 1;
STest test;
do
{
fin=fopen("test.txt","r");
fout=fopen("t.tmp","w");
while(readHistoryFile(fin, &test) != EOF)
{
if (test.b == 20160516) // to add the judgement case.
{
printf("test.b < 20160516\n");
}
else
{
test.a = counter;
writeHistoryFile(fout, test);
counter++;
}
}
fclose(fin);
fclose(fout);
remove("test.txt");
rename("t.tmp","test.txt");
}while(0);
return;
}