School of Engineering and Applied Science
Department of Computer Science
CSci 49 -- Introduction to C Computing
http://www.seas.gwu.edu/~csci49/spring06
Prof. Michael B. Feldman
mfeldman@gwu.edu

Lab Exercise #5
Wednesday, April 12, 2006

Objectives: This lab will help you understand arrays and external files.

Copy and compile programs49/fig06_08.c. Run it to observe its behavior. Now modify the program so that instead of "hard-wiring" the data with an initializer, the program reads its data from an external input file named histo.dat. You can use a count-controlled loop to read SIZE values from the file.

Reading from an input file is similar to writing to an output file, as in Project 6. The differences are:
The data file histo.dat is in programs49; you can copy it and run the program, to get the same results as in the original example. The you can modify the file with vi, to get a different histogram.

(end of lab)