rendered paste body// APS105 Lab4Part2 10/11/06
// Geoffrey Lang
// 995155772
// langgeof@ecf.utoronto.ca
#include <iostream>
#include <fstream>
#include <cstdlib>
using namespace std;
int main ()
{
char current;
int totalchar=0;
ifstream in_stream;
char filename[128];
string << "Please enter the filename: ";
cin >> filename;
in_stream.open(filename);
if(in_stream.fail())
{
cout << "Failed to open input file.\n";
exit (1);
}
else
{
do
{
cin.get(current);
cout.put(current);
totalchar++;
} while (!cin.eof());
cout << totalchar << " characters processed.\n";
in_stream.close(filename);
}
return 0;
}