/* Illustrates use of cmd line args. v. 8/8/04 */ #include #include using namespace std; int main( int argc, char *argv[] ) { /* Copy files to stdout */ for ( int i=1; i < argc; ++i ) { // open file stream associated with i-th parm ifstream fin( argv[i] ); if ( fin ) { char c; while ( fin.get( c ) ) cout << c; } else { cerr << argv[0] << ": " << argv[i] << " not a valid file name " << endl; return 1; } } return 0; }