Home Segments Index Top Previous Next

638: Mainline

You can write most of the rest of do_analysis by copying statements from the version of main in Segment 627 with just one small modification: Previously, serial numbers were read from the standard input stream:

for (car_count = 0; cin >> input_buffer; ++car_count) {...} 

Now, they are read from the stream attached to the named input file:

for (car_count = 0; car_stream >> input_buffer; ++car_count) {...}