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

Processing the Command Line

As you’ve seen, the command line is retrieved as a set of individual parameters—a list of strings contained by whitespace or in quotes. You need a mechanism to go from that to a list of parameters that you can access from within the program in order to determine the behavior of the program.

Users expect you to adhere to certain standards that they have become accustomed to. For example, they are used to starting a program with the following style of command line:

dir /o:n *.txt

This code calls the directory listing function from the Windows command line. Non-Windows users will find their own version of this: All operating systems that have a command-line interface will allow a similar level of control. The point is ...

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