458
Cat
- #include <string>
- #include <fstream>
- #include <iostream>
- #include <cstdlib>
- using namespace std;
- main( int argc, char *argv[] )
- {
- ifstream in;
- switch ( argc )
- {
- case 2:
- in.open( argv[ 1 ] );
- break;
- default:
- cerr << argv[ 0 ] << " file\n";
- exit( 1 );
- }
- string s;
- while ( getline( in, s ) )
- cout << s << endl;
- exit( 0 );
- }
Commentaires