Standard C++ Library Reference ISO/IEC (VERSION3)

when the description of the library function spells out what happens when you use a null
pointer.
Some examples are:
strcpy(s1, 0) is INVALID
memcpy(s1, 0, 0) is UNSAFE
realloc(0, 50) is the same as malloc(50)
Program Startup and Termination
The target environment controls the execution of the program (in contrast to the translator part
of the implementation, which prepares the parts of the program for execution). The target
environment passes control to the program at program startup by calling the function main
that you define as part of the program. Program arguments are C strings that the target
environment provides, such as text from the command line that you type to invoke the
program. If the program does not need to access program arguments, you can define main as:
extern int main(void)
{ <body of main> }
If the program uses program arguments, you define main as:
extern int main(int argc, char **argv)
{ <body of main> }
You can omit either or both of extern int, since these are the default storage class and type
for a function definition. For program arguments:
argc is a value (always greater than zero) that specifies the number of program
arguments.
argv[0] designates the first element of an array of C strings. argv[argc] designates
the last element of the array, whose stored value is a null pointer.
For example, if you invoke a program by typing:
echo hello
a target environment can call main with:
The value 2 for argc.
The address of an array object containing "echo" stored in argv[0].
The address of an array object containing "hello" stored in argv[1].
A null pointer stored in argv[2].
argv[0] is the name used to invoke the program. The target environment can replace this
name with a null string (""). The program can alter the values stored in argc, in argv, and in
the array objects whose addresses are stored in argv.
Before the target environment calls main, it stores the initial values you specify in all objects