++



         

main(): - 6


<< " \n";

limit_on = true;

break;

default:

cerr << program_name

<< " : : "

<< " : - "

<< pchar << "\n\n";

// break : usage()

usage( -1 );

}

break;

}

default: //

cout << "default: : "

<< pchar << endl;

if ( ofile_on ) {

ofile_on = false;

ofile = pchar;

}

else

if ( limit_on ) {

limit_on = false;

limit = atoi( pchar );

if ( limit < 0 ) {

cerr << program_name

<< " : : "

<< " limit.\n\n";

usage( -2 );

}

}

else file_names.push_back( string( pchar ));

break;

}

}

if ( file_names.empty() ) {

cerr << program_name

<< " : : "

<< " .\n\n";

usage( -3 );

}

if ( limit != -1 )

cout << " limit: "

<< limit << endl;

if ( ! ofile.empty() )

cout << " : "

<< ofile << endl;

cout << (file_names.size() == 1 ? ", " : ", ")

<< "() :\n";

for ( int inx = 0; inx < file_names.size(); ++inx )

cout << "\t" << file_names[ inx ] << endl;

}

a.out -d -l 1024 -o test_7_8 chapter7.doc chapters.doc

:

:

argc: 8

argv[ 1 ]: -d

'-'

-d:

argv[ 2 ]: -l

'-'

-l:

argv[ 3 ]: 1024

default: : 1024

argv[ 4 ]: -o

'-'

-o:

argv[ 5 ]: test_7_8

default: : test_7_8

argv[ 6 ]: chapter7.doc

default: : chapter7.doc

argv[ 7 ]: chapter8.doc

default: : chapter8.doc

limit: 1024

: test_7_8

, () :

chapter7.doc

chapter8.doc