//-------------------------------------------------------------------------------- // C++ demonstration program for end of file and error handling. // A. Fischer, April 2001 file: main.cpp #include "tests.hpp" int main( int argc, char* argv[] ) { banner(); // Command line must give the name of the program followed by 2 file names. if (argc < 3) fatal( "Usage: eof_demo textfile numberfile" ); cout <<"\nIOstream flags are printed after each read in order:\n" <<"goodbit : eofbit : failbit : badbit :\n"; // Test get on text file getTester gtest( argv[1] ); gtest.run(); // Test getline on text file getlineTester gltest( argv[1] ); gltest.run(); // Test numerical I/O on number file numsTester ntest( argv[2] ); ntest.run(); }