// file test2.C shows another way to opena file for input #include #include #include main() { int ch; int count = 0; // declare a stream object ifstream testf; //amd open it testf.open("test1.C"); while ( (ch= testf.get()) !=EOF) { cout << (char)ch; //write the char just read count++; } cout <<" I read " << setw(1) << count << " characters" <