The showArgs.cprogramis an extremely simple command-line argument processor. It merely prints out each command-line argument but otherwise does nothing with any of them. In later chapters, we will see some ways that we might use these arguments.
We have been using command-line switches whenever we compiled our programs. Consider the following command:
cc showArgs.c -o showArgs -Wall -Werror -std=c11
We have given the ccprogram the following arguments:
- The name of the input file to compile, which is showArgs.c.
- A output file specifier, which is -o.
- The name of the output file, which is showArgs. This represents an argument pair where the specifier and additional information is given in the very next argument. Notice how the specifier is preceded by a hyphen (-).
- The option to provide warnings for all possible types of warnings with -Wall...