c语言课百件 第10章.pptVIP

  • 2
  • 0
  • 约1.04万字
  • 约 88页
  • 2021-04-01 发布于福建
  • 举报
fclose(fp); puts(Enter x to exit,any other to continue.); if((ch=getc(stdin))==x) break; else continue; } else{ fprintf(stderr,Error opening file %s in mode %s\n, filename,mode); perror(filename); puts(Enter x to exit,any other to try again.); if((ch=getc(stdin)) == x) break; else continue; } } return 0; } 10.7.3 文件的读写 写文件可以有三种方式: ① 使用格式化输出函数把文本数据保存到文件上。 ② 使用字符输出函数把单个字符或整行字符保存到文件上。 ③ 使用直接输出函数把内存区中的内容直接保存到磁盘文件中。 同样,从文件中读取数据也有三种方式:格式化输入、字符输入和直接输入。 这两种

文档评论(0)

1亿VIP精品文档

相关文档