Home Segments Index Top Previous Next

600: Mainline

In the analyze_train program shown in Segment 541, the following for loop reads integers from your keyboard (or from a file if you used an input redirection mechanism). Those integers are then assigned successively to the integer variable, type_code:

for (n = 0; cin >> type_code; ++n) 
  ... 

Analogously, the following for loop reads strings, depositing each, in turn, in the front part of the input_buffer array—the place where TPW-E-783 is located in the example.

for (n = 0; cin >> input_buffer; ++n) 
  ...