Normally, output (e.g. std::cout) sends its output to the screen. To send it to a file instead, use the greater-than (>) symbol:
Any output from myprogram will go to a file named out.txt and you will see nothing on the screen.myprogram > out.txt
Normally, input (e.g. std::cin) is read from the keyboard. To have the program read input from a file instead, use the less-than (<) symbol:
All input to myprogram is read from in.txt, and the keyboard is ignored. Also, none of the characters that are in the file will show on the screen.myprogram < in.txt
You can redirect both input and output at the same time like this:
myprogram < in.txt > out.txt
Name Main topics 1. tablen Command line options, ANSI colors, flexible runtime behavior 2. dumpit Command line options, ANSI colors, flexible runtime behavior 3. prp Implementing page replacement algorithms: FIFO, Clock, and LRU. Of course, command line options are required (and always will be with utility programs).
You can earn 40 points of extra credit on the homework if you complete this correctly.