Skip to content

Text files: write then read · ⁨文本文件:先写后读⁩

English

Files keep data after the program ends

  • A file stores data on disk, so it is still there after your program stops.
  • You work with a file through a FILE * — a pointer you get from fopen.
  • In these tasks you write a file, then read it back in the same program, so everything is self-contained.
中文

文件让数据在程序结束后保留

  • 文件把数据存在磁盘上,所以程序停止之后它还在。
  • 你通过一个 FILE * 来操作文件 —— 这是 fopen 给你的一个指针。
  • 在这些任务里,你先写一个文件,再在同一个程序里把它读回来,所以一切都是自包含的。

Handout

Log in or create account · ⁨登录或创建账户⁩

IGCSE, A-Level · ⁨IGCSE、A-Level⁩ & AP · ⁨与 AP⁩