Electrical and Computer Engineering
11 of 19
UAH
CPE 112
Implementation
•void OpenForOutput( /*inout*/ ofstream& someFile )  // File to be
•                                                    // opened
•{
•    string fileName;    // User-specified file name
•
•    cout << "Output file name: ";
•    cin >> fileName;
•
•    someFile.open(fileName.c_str());
•    if ( !someFile )
•        cout << "** Can't open " << fileName << " **" << endl;
•}