Program termination and library facilities are not available to a free-standing program. Only a hosted environment is available. (2.1.2.1)
Arguments passed to a C program from the AIX operating system command line can be retrieved as arguments of the function main. (2.1.2.2.1) The first argument passed indicates the number of white-space-separated parameters supplied. The second argument is an array of pointers to these parameters. The third argument is a null-terminated array of pointers to a set of system arguments for the program. The arguments are traditionally named argc, envp[], and argv[], but these names are not mandatory. To access these variables, the main() function of your program must declare them as arguments. The following table summarizes the main() function arguments and their uses.
Name | Meaning | Purpose |
---|---|---|
int argc | Argument count | Contains the number of parameters supplied on the command line. The name with which the program was invoked is the first parameter. |
char* argv[ ] | Argument vector | An array of pointers to character strings. Each character string is a parameter supplied on the command line. Valid pointers are from argv[0] to argv[argc-1]. argv[0] is the command name, and argv[1:] contains what was specified as the first argument to the command. |
char* envp[ ] | Environment pointer | An array of pointers to character strings. Each character string is an environment parameter supplied to the program. The array ends at the first null pointer (array element with a value of zero). |
An asynchronous terminal and a paired display and keyboard are the valid interactive devices. (2.1.2.3)
Implementation-Defined Behavior
Implementation Dependencies