Learn C Programming

Lesson 2 of 9 · Files

Module 13 · Files

Reading and Writing Text Files

Free with an accountReading

Every evening Maria's till program writes one line: the day, and how many sales it made. She wants a log, a list that grows by one line a day.

Checking what this lesson needs for you…

What is inside Reading and Writing Text Files

  1. Write lines, then read them back
  2. fgets keeps the newline
  3. Append mode: the log grows at the end
  4. The file position, and rewind
  5. One function for a file and for stdin