0.5 — Setting up your tools

📘 Chapter 0⏱ about 1 min read✍️ Beginner friendly
Read one box at a time. No rush.

To write C++, you need a compiler and somewhere to type code. Pick one option below.

Option 1: Try it in your browser (easiest)#

No install needed. Open a website, type code, press Run.

Tip

Online tools are perfect for the first few chapters. Install real tools later, when you want to build bigger things.

Option 2: Windows#

Install Visual Studio Community (free). During setup, tick "Desktop development with C++".

Then: Create a new project → Console App → press the green ▶ button to run.

Option 3: Mac#

Open the Terminal app and type:

text
xcode-select --install

This gives you a compiler called clang. You can then use the editor VS Code with the C++ extension, or just the terminal.

Option 4: Linux#

Install the g++ compiler with your package manager. On Ubuntu:

text
sudo apt install g++

Running from a terminal#

If you use a terminal, save your code as main.cpp, then type:

text
g++ -std=c++20 -Wall main.cpp -o hello./hello
  • -std=c++20 = use modern C++.
  • -Wall = show all warnings. This catches many mistakes early.
  • -o hello = name the program hello.
IDE

Short for Integrated Development Environment. An app that puts an editor, compiler and debugger together in one place. Visual Studio and CLion are IDEs.

Finished reading? Tick it off. Your progress is saved in this browser.

Tip: press ← / → to move between lessons, / to search.