Home Segments Index Top Previous Next

332: Mainline

Recall that, if you are using Unix or Dos, you can redirect input from your keyboard to a file, enabling you to use the program in Segment 331 to find the volumes of box cars that you have described in a file. The only new fact that you need to know is that input expressions evaluate to 0 when the end of a file is encountered.

Thus, to find the volumes of some boxes described in a file, you need only to type the following to your operating system, assuming that you have called your box-analyzing program box_car and that you have prepared a test file named test_data:

box_car < test_data