everest% CC io7.C everest% everest% a.out Enter a filename: foo Could not open file: foo everest% everest% a.out Enter a filename: data1 5 2 4 6 8 10 everest% everest% a.out Enter a filename: io0.C // File: io0.C // // Demonstrating simple I/O in C++ #include #include // for endl, setw(), etc #define BUFLEN 8 typedef char buffer[BUFLEN] ; main() { buffer buf1, buf2 ; cout << &buf1 << endl ; cout << &buf2 << endl ; cout << "Enter a filename: " ; cin >> buf2 ; cout << "You entered: " << buf2 << endl ; cout << "Enter another filename: " ; cin >> buf1 ; cout << "You entered: " << buf1 << endl ; cout << "First file name is: " << buf2 << endl ; } everest%