SOURCE FILE: ex0903.cpp


//
// Example 9.3. Program to make a copy of a file of integers
// Files: ex0903.dat   - input file of integers separated by blanks 
//        ex0903ot.dat - output file of integers
//

#include <fstream.h>
#include <assert.h>

int main(void)
{
   int num;   // integer to read and write
      
   ifstream infile("ex0903.dat");
   assert(infile);

   ofstream outfile("ex0903ot.dat");
   assert(outfile);
   
   // make a copy of the input file to the output file
   while (infile >> num)
      outfile << num << ' ';
 
   assert(infile.eof());
      
   return 0;
}