12345678910111213141516171819
#include <iostream> #include <fstream> #include <string> using namespace std; int main(int argc, const char * argv[]) { fstream file("~/txt.txt"); if (file.is_open()) { cout << "File not open" << endl; return -1; } for (string line; getline(file,line); ) { cout << line << endl; } cout << "done" <<endl; return 0; }