Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<fstream>
- using namespace std;
- int main() {
- ifstream iFile("text.txt");
- iFile.seekg(6, ios::beg);
- char ch;
- iFile.get(ch);
- cout << ch << endl;
- iFile.seekg(-6, ios::end);
- iFile.get(ch);
- cout << ch << endl;
- iFile.seekg(3, ios::cur);
- iFile.get(ch);
- cout << ch << endl;
- iFile.seekg(0, ios::end);
- cout << "size of file: " << iFile.tellg() << endl;
- iFile.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement