int main () { char current; string filename; int totalchar=0; ifstream in_stream cout << "Please enter the filename: "; cin >> filename; instream.open(filename); if(in_stream.fail()) { cout << "Failed to open input file.\n" } else { do { cin.get(current); cout.put(current); totalchar++; } while (!cin.eof()); } cout << totalchar << " characters processed.\n"; return 0; }