Suppose you are continuing to write the program discussed in the previous exercise and you want your program to take its input from the file stuff1.dat and send its output to the file stuff2.dat. What statements
do you need to place in your program in order to connect the stream fin
to the file stuff1.dat and to connect the stream fout to the file stuff2.dat? Be sure to include checks to make sure that the openings were successful.
fin.open("stuff1.dat");
if (fin.fail( ))
{
cout << "Input file opening failed.\n";
exit(1);
}
fout.open("stuff2.dat");
if (fout.fail( ))
{
cout << "Output file opening failed.\n";
}