C/C++ Programmer's Guide (G06.25+)

HP C Implementation-Defined Behavior
HP C/C++ Programmer’s Guide for NonStop Systems429301-008
A-16
G.3.3 Identifiers
When a program calls exit() or terminate_program(), the process
completes with normal or abnormal termination depending upon the completion
code assigned to the status or options parameters, respectively.
HP TNS C allows the declaration of up to three parameters to the program's function
main.
int main(int argc, char *argv[], char *env[])
When declaring parameters to the function main, note the following:
The parameters to main are optional; there can be no parameters, argc and argv,
or all three parameters. env alone is not allowed.
The identifiers argc, argv, and env are simply the traditional names of the three
parameters to main; any identifiers may be used.
The elements of the environment array env point to strings of the form:
param-name=param-value
where param-name is the name of the environment parameter, and param-
value is its value.
The following are valid interactive devices:
Asynchronous terminal
Paired display and keyboard
NonStop operating system processes
G.3.3 Identifiers
No characters beyond 31 are significant in an identifier without external linkage.
Beyond 6 characters, only 2 are significant in an identifier with external linkage. Case
is significant in an identifier with external linkage.
Parameters Description
argc An integer value specifying the number of elements in the argument
array argv
argv The argument array. Each element (except for the last) points to a
null-terminated string. argv[0] points to the fully qualified name of
the executing program, the executing program name being that used
in the RUN command. Each of the elements argv[1] through
argv[argc-1] points to one command-line argument; argv[argc]
has the pointer value NULL.
env The environment array. Each element (except for the last) points to a
null-terminated string containing the name and value of one
environment parameter. The last element has the pointer value NULL.