本人菜鸟,想做个批量改文件名的东东,请各位帮忙看看,不胜感激。
#include <stdio.h>
#include <dir.h>
#include <string.h>
int main()
{
char ch,newname[256];
struct ffblk ffblk
int done;
done = findfirst(C:\Users\Secret~~~\Desktop\peanuts\\*.*);
while (! done){
ch = a.ff_name[strlen(a.ff_name) - 1];
ch = ch - 1;
strcpy(newname,"data");
strcat(newname,ch);
rename(a.ff_name,newname)
done = findnext(a);
}
return 0;
}
#include <stdio.h>
#include <dir.h>
#include <string.h>
int main()
{
char ch,newname[256];
struct ffblk ffblk
int done;
done = findfirst(C:\Users\Secret~~~\Desktop\peanuts\\*.*);
while (! done){
ch = a.ff_name[strlen(a.ff_name) - 1];
ch = ch - 1;
strcpy(newname,"data");
strcat(newname,ch);
rename(a.ff_name,newname)
done = findnext(a);
}
return 0;
}