#include #include #include int main() { std::ifstream inf{ "Deneme.txt" }; // If we could not open the input file stream for reading if (!inf) { // Print an error and exit std::cerr << "Shit, Deneme.txt file could not be opened for reading!\n"; return 1; } std::string strData; inf.seekg(5); // Switch to 5th character // Take the rest of the line and go to line 2 and print std::getline(inf, strData); std::cout << strData << '\n'; inf.seekg(8, std::ios::cur); // move another 8 bytes to file // Take the rest of the line and print std::getline(inf, strData); std::cout << strData << '\n'; inf.seekg(-14, std::ios::end); // move 14 bytes before the end of the file // Take the rest of the line and print std::getline(inf, strData); std::cout << strData << '\n'; return 0; }