#include #include #include int main() { // used to read ifstream files // We will read from a file called Trial.txt std::ifstream inf{ "Deneme.txt" }; // If we cannot open the output file stream for reading if (!inf) { // Print an error and exit std::cerr << "Shit, Deneme.txt could not be opened for reading!\n"; return 1; } // While there's still something to read while (inf) { // read and print something from a file to a string std::string strInput; std::getline(inf, strInput); std::cout << strInput << '\n'; } return 0; // When inf goes out of scope, ifstream // will close the destructive file }