In Chapter 1, Building C++ Applications, we learned that the compiler generates an executable file after compiling the source code. The executable file contains machine code that can be copied to the memory of the computer to be run by the Central Processing Unit (CPU). The copying is done by an internal tool of the OS called a loader. So the operating system (OS) copies the contents of the program to the memory and starts executing the program by passing its first instruction to the CPU.
Program execution
main()
Program execution starts with the main() function, the designated start of the program as stated in the standard. A simple program outputting the Hello, World! message will look like this:
#include <iostream>...