![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
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 212 to find the trade prices of trades that you have described in a file. The only new fact you need to know is that read expressions stop, returning the number of values read so far, when the end of a file is encountered.
Thus, to find the trade prices of some trades described in a file, you need
only to type the following to your operating system, assuming that you have
called your trade-analyzing program analyze_trades
and that you have
prepared a test file named test_data
:
analyze_trades < test_data