This document is available online at http://helios.hampshire.edu/jdavila/cs109/hw_3.htm

 CS 109: Homework #3: Arrays and file input/output.

Last Updated: October 22, 2000
This homework is due on Thursday, October 26.


Write a program that reads the content of a file into an array of characters. You will need to pre-establish how many characters, maximum, there's going to be in the file; you can then set the size of the array accordingly.

Because the file can contain "blank spaces" (i.e. spaces, tabs, returns, etc.) you will need to input the elements on a character by character basis, as opposed to trying to read all of the file at one time.

After you have read the contents of the file into an array, write the content of the array back to the file, this time with the characters in the reverse order that they were in before.

Your project should be divided into several different files. At a minimum, you should have one file that contains the main program, one file that contains auxiliary functions, and one header file.