<p>I am looking for a more technical explanation than the OS calls the function.</p>
<p>Is there a website or book?</p>

```
main()
```
is part of the C library and is not a system function. I don't know for OS X or Linux, but Windows usually starts a program with
```
WinMainCRTStartup()
```
. This symbol init your process, extract command line arguments and environment (
```
argc, argv, end
```
) and calls
```
main()
```
. It is also responsible of calling any code that should run after
```
main()
```
, like
```
atexit()
```
.
By looking in your Visual Studio file, you should be able to find the default implementation of
```
WinMainCRTStartup
```
to see what it does.
You can also define a function of your own to call at startup, this is done by changing "entry point" in the linker options. This is often a function that takes no arguments and returns a void.