// File: io2.C
//
// Demonstrating simple I/O in C++

#include <iostream.h>
#include <iomanip.h>    // for endl, setw(), etc
#include <limits.h>     // for INT_MAX constant, etc

#define BUFLEN 8

typedef char buffer[BUFLEN] ;

main() {
   buffer buf1, buf2 ;

   cout << "Enter a filename: " ;
   cin >> setw(BUFLEN) >> buf2 ;
   cin.ignore(INT_MAX, '\n') ;
   cout << "You entered: " << buf2 << endl ;

   cout << "Enter another filename: " ;
   cin >> setw(BUFLEN) >> buf1 ;
   cin.ignore(INT_MAX, '\n') ;
   cout << "You entered: " << buf1 << endl ;

   cout << "First file name is: " << buf2 << endl ;
}
