Electrical and Computer Engineering
7 of 23
UAH
CPE 112
Recognizing Two
Character Sequences
•  
•     char     currChar;     // Character read in this loop
•                           // iteration
•     ifstream inFile;        // Data file
•     inFile.open("myfile.dat");   // Attempt to open
• // input file
•     if ( !inFile )              // Was it opened?
•     {
•        cout << "** Can't open input file **"  // No—print
•        // message
•             << endl;
•        return 1;                         // Terminate
•   // program
•     }
•