以下程序由终端键盘输入一个文件名,然后把从终端键盘输入的字符依次放到该文
件中,用井作为结束输入的标志。请填空。
# include<stdio.h>
main( )
FILE * fp;
char ch,fname[10];
printf("Input the name of file\n");
gets(fname);
if((fp= 【16】 )==NULL)
printf("Can not ope\n");exit(O);
printf("Enter data\n");
while((ch=getchar())!=’ # ’)
fputc( 【17】 ,fp);
fclose(fp);