home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / C++-7 / DISK4 / SAMPLES / IOSTUTOR / EXIOS122.CP$ / EXIOS122
Encoding:
Text File  |  1992-01-29  |  441 b   |  23 lines

  1. // exios122.cpp
  2. // An fstream file
  3. #include <fstream.h>
  4. #include <ctype.h>
  5.  
  6. void main()
  7. {
  8.    fstream tfile( "test.dat", ios::in | ios::app );
  9.    char tdata[100];
  10.    int i = 0;
  11.    char ch;
  12.  
  13.    while ( i < 100 ) {
  14.       tfile.get( ch );
  15.       if ( tfile.istream::eof() ) break;
  16.       tdata[i++] = ch;
  17.    }
  18.    tfile.istream::clear();
  19.    for ( int j = 0; j < i; j++ ) {
  20.       tfile.put( (char)toupper( tdata[j] ) );
  21.    }
  22. }
  23.