|
|
1.1 ! root 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: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.