Home Segments Index Top Previous Next

632: Mainline

First, assume that you have moved to the newly created do_analysis function the declarations and statements in the version of main in Segment 627. Some details need to be added to do_analysis, to be sure; for the moment, however, concentrate on what you need to do to obtain a file name in the new version of main.

Recall that the program, as it stands, defines input_buffer to be a character array. Accordingly, you can have the program insert a file name into that array:

cin >> input_buffer; 

Then, once the program has a file name, you can have it attempt to open the corresponding file:

ifstream car_stream (input_buffer);