#include #include #include using namespace std; void TellAboutData(string data); int main() { string fileName; ifstream inFile; string data; cout << "Enter the file name: " ; cin >> fileName; inFile.open(fileName); // read the 1 with a stream extraction operator inFile >> data; TellAboutData(data); // comment this out inFile.ignore(1000, '\n'); // now read the 2 with a getline getline(inFile,data); TellAboutData(data); inFile.close(); return 0; } void TellAboutData(string data){ cout << "The length of data is " << data.size() << endl; cout << "Data is \"" << data << "\"" << endl; cout << endl; return; }