C: A Reference Manual; 5th ed.
When arguments are declared, those arguments are set up by the execution enviorn-
ment and are not directly under control of the C programmer. The parameter argc
count of the number of "program arguments" or "options" supplied to the program when it
was invoked by a user or another program. The parameter argv
is a vector of pointers to
strings representing the program arguments. The first string, argv
, is the name of the
program; if the name is not available, argv
must be '\0'
. The string argv[i]
for i=1, ..., argc-1
, is the i
th program argument. Standard C requires that argv[argc]
be a null pointer, but not so in some older implementations. The vector argv
strings to which it points must be modifiable
, and their values must not be changed by the
implementation or host system during program execution. If the implementation does not
support mixed-case strings, then the strings stored in argv
must be in lower case.