The main function is called at program startup after initialization of the non-local objects with static storage duration. It is the designated entry point to a program that is executed in a hosted environment (that is, with an operating system). The entry points to freestanding programs (boot loaders, OS kernels, etc) are implementation-defined.
Now examine the following line.
int main()
Notice that the parameter list in main() is empty. In C++, this indicates that main() has no parameters. This differs from C. In C, a function that has no parameters must use void in its parameter list.
The main function has several special properties:
The main() function doesn't really have to do anything other than be present inside your C++ source code.
It cannot be called recursively.
Its address cannot be taken.
It cannot be predefined and cannot be overloaded: effectively, the name main in the global namespace is reserved for functions (although it can be used to name classes, namespaces, enumerations, and any entity in a non-global namespace, except that a function called "main" cannot be declared with C language linkage in any namespace (since C++17)).
It cannot be defined as deleted or declared with C language linkage (since C++17), inline , static, or constexpr.