//========================================================================
//  File:  DemoEof.cpp
//  Demonstrate how to input until Input Failure (EOF) in CodeWarrior
//========================================================================
//  Use the .fail() function instead of .eof() -- it's the ANSI standard
//========================================================================
      
#include <iostream.h>
#include <console.h>
      
int main (int argc, char *argv [])
{
     argc = ccommand (&argv);    // handle redirection...
     
     cout << "Grab integer inputs from cin until Input Failure"
          << endl 
          << endl;
      
     int  nInt;
     
     cin >> nInt;            // loop until input failure...
     while (!cin.fail ())        // (EOF is one kind of failure)
     {
         cout << "Process " << nInt << endl;
         
         cin >> nInt;
     };
     
     cout << endl << "That's all folks!" << endl;

     return 0;
}
      
//===================================================================

