刚写了段代码,VC6.0编译不报错,但就是不能运行,求教达人看看哪错了呢?
#include<stdio.h>#include<string.h>
int main()
{
int i;
char FileName_in[100];
char FileName_out[100];
FILE *fin,*fout;
char line[200];
for(i=1;i<100;i++)
{
sprintf(FileName_in,"%d.txt",i);
sprintf(FileName_out,"S_%d.txt",i);
fin = fopen("C:\\FileName_in", "r");
fout = fopen("C:\\FileName_out", "w+");
while(!feof(fin))
{
fgets(line,200,fin);
if(strstr(line,"CA"))
fputs(line,fout);
}
fclose(fin);
fclose(fout);
}
}
[ 本帖最后由 惜小君 于 2012-6-21 13:29 编辑 ]