Every C and C++ program must have a program-startup function.
- Console-based programs call the main function at startup.
- Windows GUI programs call the WinMain function at startup.
Where you place the startup function is a matter of preference. Some programmers place main at the beginning of the file, others at the end. Regardless of its location, the following points about main always apply.
- Arguments to main
- Wildcard arguments
- Using -p (Pascal Calling Conventions)
- The value that main() returns