// File: bsmain6.C // // Testing the BString class. #include #include #include #include #include #include #include "bstring2.h" // version 2 main() { ifstream ifile ; BString fname, line ; cout << "Enter a filename: " ; cin >> fname ; ifile.open(fname) ; if (ifile == NULL) { cerr << "Could not open file: " << fname << endl ; exit(1) ; } // Print out contents of the file // while (ifile >> line) { // ends with p == NULL cout << line << endl ; } ifile.close() ; }