#include
#include
int main(void)
{
char ch;
FILE*fp;
char fli[20];
printf("一个文件名\n");
scanf("%s", &fli);
while (getchar() != '\n')
{ continue;
}
puts("输入一些字符到文件中");
if ((fp = fopen(fli, "w")) == NULL)
puts("无法打开文件");
else
{
while(ch = getchar() != '\n')
fputc(ch,fp);
}
fclose(fp);
return 0;
}
这样的情况