Skip to main content

Dive Into Systems: Exercises

Section 2.8 Input/Output in C

Checkpoint 2.8.1. Format descriptors.

Checkpoint 2.8.2. Parsons Problem: File I/O.

Put the following lines of code in order to read a single integer value into the variable named population from the file demographics.txt. If the file cannot be opened, the code should print "Error opening file" and then quit with a call to exit().