home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 13 / CDA13.ISO / cdactual / demobin / share / program / C / ANSICPP.ZIP / EX10023.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1990-07-24  |  272 b   |  16 lines

  1. // ex10023.cpp
  2. // The tellg function
  3. #include <fstream.h>
  4.  
  5. main()
  6. {
  7.     ifstream tfile("test.dat");
  8.     while (!tfile.eof())    {
  9.         char ch;
  10.         streampos here = tfile.tellg();
  11.         tfile.get(ch);
  12.         if (ch == ' ')
  13.             cout << "\nPosition " << here << " is a space";
  14.     }
  15. }
  16.