文件写入错误
#include <stdio.h>#include <stdlib.h>
#include <iostream>
int main(void)
{
FILE *out;
char ch,outfile[10];
printf("output outfile name: ");
scanf("%s",outfile);
if( (out=fopen(outfile,"w"))==NULL )
{
printf("cannot open the outfile.\n");
exit(0);
}
while(!feof(out))
{
fputs("hello,world.",out);
}
putchar('\n');
fclose(out);
system("pause");
return 0;
}
大家看看代码写的有问题吗