Lab 2: File Operations and Unbuffered I/O

Preliminaries

Tasks for today:
  1. To get familiar with string operations
  2. To get familiar with file operations

TODO:
  1. Write a program that reads test.txt in.
  2. Add 100 to the number in the file.
  3. Print out the new sum.
  4. Example:
    • $ cat test.txt
    • $ sum: 200
    • $ ./my_program
    • $ 300
Standard I/O: Let's use unbuffered I/O:

Author: Zhuoqun (Tom) Cheng.