O'Reilly logo

Just Enough C/C++ Programming by Guy W. Lecky-Thompson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Reporting Parameter Errors

One of the purposes for checking the supplied argument list is that you can identify potential errors in the parameters supplied before you begin execution of the program itself. This helps you identify the true source of the errors and helps the users when they are deploying the program for the first time.

There are two kinds of command-line arguments—those with and without values. Normally, a program should run without optional parameters or switches; any required parameters should indicate a value. Flags, or switches without parameters, should always be optional.

Certain parameters will be listed as mandatory; in other words, they are required for the program to be able to do its job correctly. These parameters ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required