home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / OTHERUTI / TCPP30-3.ZIP / EXAMPLES.ZIP / INTRO36.CPP < prev    next >
C/C++ Source or Header  |  1992-02-18  |  360b  |  19 lines

  1. //INTO36.CPP--Example from Chapter 3, "An Introduction to C++"
  2.  
  3. #include <fstream.h>
  4.  
  5. int main()
  6. {
  7.      char ch;
  8.      ifstream f1 ("OLDFILE.TXT");
  9.      ofstream f2 ("NEWFILE.TXT");
  10.  
  11.      if (!f1) cerr << "Cannot open OLDFILE.TXT for input";
  12.      if (!f2) cerr << "Cannot open NEWFILE.TXT for output";
  13.  
  14.      while (f2 && f1.get(ch))
  15.          f2.put(ch);
  16.  
  17. return 0;
  18.  
  19. }