Guest User

Untitled

a guest
Sep 20th, 2012
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <fstream>
  4. #include <sstream>
  5. #include <cstring>
  6. using namespace std;
  7.  
  8. int main () {
  9.  
  10.  
  11. ifstream file1;
  12. file1.open("test.txt");
  13.  
  14.  
  15.  
  16. file1.seekg(0);
  17. cout<<file1.tellg();
  18. cout<<(char)file1.get();
  19. cout<<file1.tellg();
  20. cout<<(char)file1.get();
  21. cout<<file1.tellg()<<endl;
  22. file1.seekg(4);
  23. cout<<(char)file1.get();
  24. cout<<file1.tellg();
  25.  
  26. getchar();
  27. return 0;
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment