#include #include #include #include using namespace std; int main() { string line; string datafile; cerr << "What is your datafile: "; getline(cin,datafile); ifstream mydata(datafile.c_str()); // Check that the file was opened successfully. if(mydata==NULL) { cerr << "FILE NOT FOUND!" << endl; exit(-1); } // While mydata did not reach the end of the file. while(!mydata.eof()) { getline(mydata,line); cout << line << endl; } mydata.close(); }