🐫Program Execution Model
When one develops a C++ program, it does not run directly. Instead, it goes through a fixed sequence of steps before your computer actually understands and executes it.
Running Your Source Code
Let's start with a simple single-file C++ program. The following prints Hello World to the console.
#include <iostream>
int main() {
std::cout << "Hello, world!";
return 0;
}This file is called the source code.
To run it, we need to compile the code:
clang++ main.cpp -o hello-worldThis will produce an executable file called hello-world which your computer can finally run:
./hello-worldEach time you make changes to the source code, you will need to compile again.

What Just Happened ?!
Think of a compiler as a black box that simply converts source code to machine code.
Last updated

