正在加载图片...
例16.1把从键盘输入的文本按原样输出到名为 fle_ada文件中去用字符@作为结束标志 # include“ stdio. h main( FILE *fpout char c if((fpout fopen(file adat, W)=NULL) printf( cant open this file! n); exit(0);) ch=getchar while(ch!=(@) &fputc(ch, fpout ) ch-getchar0: 1 fclose(spout)例16.1 把从键盘输入的文本按原样输出 到名为 file_a.dat文件中去,用字符@作为结束标志. #include “stdio.h” main() { FILE *fpout; char ch; if((fpout=fopen(“file_a.dat,”w”))==NULL) {printf(“can’t open this file!\n);exit(0);} ch=getchar(); while(ch!=‘@’) {fputc(ch,fpout); ch=getchar();} fclose(fpout); }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有