C语言批量创建 文件
#调用方法 name(filename,numbers)
#include "stdio.h"
#include "string.h"
#include "stdlib.h"
FILE *p;
void name(char *s, char n)
{
char name[10] = "";
strcat(name, s);
char a = strlen(s);
strcat(name, "a.c");
// printf("%s\r\n", name);
for (char i = 49; i < 49 + n; i++)
{
name[a] = i;
printf("%s\r\n", name);
p = fopen(name, "w");
fclose(p);
}
}
int main(int argc )
{
name("test", 4);
return 0;
}