#include #include using namespace std; int main() { ifstream fd("/home/www/class/een318/namesonly.txt", ios::in); if (fd.fail()) { cerr << "didn't work\n"; exit(1); } int pos = 0; while (true) { pos = fd.tellg(); string line, state; getline(fd, line); if (fd.fail()) break; state = line.substr(0, 2); line = line.substr(3); cout << pos << ": " << line << " (" << state << ")\n"; } cout << "end at " << pos << "\n"; fd.close(); }