Revisit Simple File I/O Example
//Reads three numbers from the file infile.dat, sums the numbers,
//and writes the sum to the file outfile.dat.
in_stream.open("infile.dat");
cout << "Input file opening failed.\n";
out_stream.open("outfile.dat");
cout << "Output file opening failed.\n";
int first, second, third;
in_stream >> first >> second >> third;
out_stream << "The sum of the first 3\n"
<< "numbers in infile.dat\n"
<< "is " << (first + second + third)
Note that there is no output to the screen
and no input from the keyboard