Write and run your first C++ program, and understand every line of it.

In this video:

  • int main(): every program starts running from the code between its curly braces
  • return 0; tells the system the program finished successfully (any other number means a problem); leaving it out also returns 0
  • #include <iostream> brings in the part of the standard library that reads and prints text
  • Printing with std::cout and the insertion operator <<
  • The semicolon ; ends a statement
  • Ending a line with std::endl or with "\n" inside the text