File Input and Output Exercises
- Write a program which prompts the user for the name of a file to open, and then reads in the file line by line. When it has finished reading the file it should print the lines in reverse order. (solution)
- Write a program which asks the user to type the name of a file to log their typing into, and then reads in lines and writes them into the named file, stopping when it has read a line consisting only a "." on a line by itself. (solution)
- Write a program which copies one file to another. The program should take two command line arguments, the first being the source file name and the second being the destination file name. (solution)
|
---|
Replies are listed 'Best First'. | |
---|---|
File I/O #1
by vroom (His Eminence) on Nov 19, 1999 at 02:08 UTC | |
File I/O #2
by vroom (His Eminence) on Nov 19, 1999 at 02:12 UTC | |
File I/O #3
by vroom (His Eminence) on Nov 19, 1999 at 02:16 UTC |
Back to
Meditations