#include #include #include #include using namespace std; int main() { // Reading one line at a time into a C++ string // \n = LF = line feed is automatically deleted int char_count; string cppstr; ifstream myfile("files-many.txt"); if (myfile.fail()) { cout << "Fail bit set" << endl; return 1; } char_count = 0; while (true) { getline(myfile, cppstr); if (myfile.eof()) { cout << "end of file" << endl; break; } cout << "\"" << cppstr << "\"" << " has length " << cppstr.length() << endl; } myfile.close(); myfile.clear(); return 0; }