写的恶搞,哪里错了 逻辑
程序代码:
#include #include #include main() { char name[10]; char tou[30]="c:\\"; char wei[5]=".txt"; char toua[10]="c:\\"; int i; FILE *fp; while(1) { for(i=0;i<5;i++){ name[i]=rand()%26+97; } strcpy(tou,toua); strcat(tou,name); strcat(tou,wei); fp=fopen(tou,"wt+"); fputs(tou,fp); fclose(fp); } }