Chapter 1 · The Quiet LobbyAnatomy of a program
3 / 13
_ _ _ _
Professor Evelyn HartC++ mentor, Aurelia Engineering Academy

The closing brace ends main. When main ends, the program ends.

7 of 7

Lesson

Anatomy of a program

A program is a list of instructions written in a language people can read. A compiler translates it into machine code the computer can run.

  1. Source codemain.cpp, text you write
  2. CompilerClang reads and translates it
  3. Executablemachine code the computer runs
  4. Outputwhat the program prints
main.cpp
#include <iostream>

int main() {
std::cout << "Good morning, Aurelia." << '\n';
return 0;
}
The compiler could not start: This browser cannot start module workers. Use Retry in the top bar.
Compiling…

Prints

Good morning, Aurelia.