The main function is the entry point to a program (in hosted environments) that can have one of the following forms:
int main() { }
int main(int argc, char* argv[]) { }
With a common extension (part of POSIX) that includes environment variables:
int main(int argc, char* argv[], char* envp[]) { }
argc represents the number of program arguments, argv is an array of null-terminated strings representing the arguments. If argv[0] is not null, it has to be the name used to invoke the program itself (or an empty string). argv[argc] is guaranteed to be null.
The main function has an implicit return 0, meaning that, unlike other functions, the return can be omitted. Additionally, after exiting the function body using return v, the equivalent of std::exit(v) is also executed.
Note that because the exit is evaluated after exiting the function body, a function try-catch block will not catch exceptions thrown during the destruction of static objects.
Finally, despite being a function, the main is additionally constrained:
main cannot be named, meaning we can't take the address of main, can't call main recursively or query the type of main
the name "main" cannot be used for other functions in the global namespace or anything with C-linkage
main cannot be deleted, constexpr, consteval, inline or static, cannot have a deduced return type or be a coroutine