Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string>
- #include <fstream>
- #include <iostream>
- using namespace std;
- int main()
- {
- // Открываем в режиме чтения, записи и с конца файла
- fstream inOut ("copyOut.txt", fstream::in | fstream::out);
- if (!inOut) {
- cerr << "Unable to open file!" << endl;
- return EXIT_FAILURE;
- }
- string s;
- fpos<int> mark;
- while (getline(inOut, s)) {
- cout << "Line: " << s << endl;
- mark = inOut.tellg();
- cout << "Mark: " << mark << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement