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

Conditional Execution

You’ve seen the phrase conditional execution before—it just means that you can execute code within a program based on testing for a given condition. Using the command-line options to selectively control a program allows you to offer flexibility and user friendliness both to the end users and to anyone testing the application.

Besides to affect the way in which the program behaves, you use conditional execution to display various messages:

  • Missing parameters required to run the application.

  • Missing conditional parameters (in conjunction with other parameters).

  • Missing values for parameters supplied.

  • Invalid parameters (including file not found).

  • Debug statements when something goes wrong.

  • General error messages.

Depending on what ...

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