An implementation shall not predefine the main
function shall not be overloaded.
Its type shall have C++ language linkage
and it shall have a declared return type of type
, but otherwise its type is
An implementation shall allow both
- a function of () returning int and
- a function of (int, pointer to pointer to char) returning int
as the type of main
In the latter form, for purposes of exposition, the first function
parameter is called argc
and the second function parameter is
, where argc
shall be the number of
arguments passed to the program from the environment in which the
program is run.
is nonzero these arguments shall be supplied in
as pointers to the initial
characters of null-terminated multibyte strings (ntmbs
shall be the pointer to
the initial character of a ntmbs
that represents the name used to
invoke the program or "".
The value of argc
The value of argv[argc]
shall be 0.
is recommended that any further (optional) parameters be added after
— end note