#include #include #include #include using namespace std; int main() { // Reading one word at a time with << // \n = LF = line feed is dropped when word after it is read 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) { myfile >> cppstr; if (myfile.eof()) { cout << "end of file" << endl; break; } cout << "\"" << cppstr << "\"" << " has length " << cppstr.length() << endl; } myfile.close(); myfile.clear(); return 0; }