![]() |
![]() |
![]() |
![]() |
![]() |
|
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
arraythe place where TPW-E-783 is located in the example.
for (n = 0; cin >> input_buffer; ++n) ...